Osclass Themes and Osclass Plugins

CSS and JavaScript Optimization in Osclass: Merge, Minify, Control

Configure built-in CSS and JS optimization safely, including exclusions and checks to prevent frontend regressions.
Product Updates & Releases
26. April 2026
3 min read
15189 views
CSS and JavaScript Optimization in Osclass: Merge, Minify, Control

Quick overview

Configure built-in CSS and JS optimization safely, including exclusions and checks to prevent frontend regressions.

What this article covers

  • Compress and minify osclass scripts and stylesheets
  • Enable optimization in osclass
  • CSS Optimization
  • JS Optimization

Practical notes

  • Validate changes in staging before production updates.
  • Track user impact with analytics, logs, and search performance signals.

Compress and minify osclass scripts and stylesheets

Optimization of scripts and stylesheets is very important for SEO, user experience and website speed. Brand new optimization features in osclass contains following features:

  • merge CSS/JS files into one
  • minify merged files (remove white spaces & comments)
  • exclude some scripts based on keyword in script URL
  • exclude merge & optimization on particular pages

Note that external libraries are not merged, as it usually cause conflicts. You should also exclude font / icon font libraries to avoid problems.

Enable optimization in osclass

To enable osclass optimize your CSS stylesheets and JS scripts, go to Oc-admin > Settings > Optimization:

PHP classifieds script osclass - enable optimization of CSS & JS

You can now enable optimization. First, there are CSS settings, then JS settings. Both has identical settings.

PHP classifieds script osclass - CSS and JS optimization settings

CSS Optimization

Enable "Merge internal CSS style sheets into one" to merge all internal CSS files into 1 big one. Note that sheets those are not on your URL are not included.

Enable "Minify/optimize merged CSS style sheet" to remove all white spaces, comments and redundant code to reduce size of master file.

Into field "CSS Exclude words" enter keywords of libraries those should be excluded, by default it should be "font" and "awesome" to exclude font libraries as well as font awesome.

Into field "CSS Exclude pages" enter pages where optimization should not be performed (i.e. home, search, item, ...) in case you experience issues on particular pages with optimized file

JS Optimization

Enable "Merge internal JS scripts into one" to merge all internal JS script files into 1 big one. Note that sheets those are not on your URL are not included. Keep in mind that merged file is placed on website as first, excluded and external scripts are placed after master file.

Enable "Minify/optimize merged JS script" to remove all white spaces, comments and redundant code to reduce size of master file.

Into field "JS Exclude words" enter keywords of libraries those should be excluded, by default it should be "tiny" to exclude tinyMCE those contains relative links to sub-libraries and would lead to JS error.

Into field "JS Exclude pages" enter pages where optimization should not be performed (i.e. home, search, item, ...) in case you experience issues on particular pages with optimized file

Also see the Core Web Vitals guide and Cache Osclass Plugin.

Frequently asked questions

Question: How do I enable Osclass CSS and JS merge in Settings Optimization?

Answer: Open oc-admin, Settings, Optimization. Enable Merge internal CSS style sheets into one and Merge internal JS scripts into one. Minify is a second checkbox. External URLs are never merged. If the front office is blank, disable merge and add exclude words. Save, then hard-refresh the home page.

Question: Why does Font Awesome break after Osclass CSS optimization?

Answer: Merged CSS can rewrite font paths. Check which CSS file contains the Font Awesome reference, then put that path or name in CSS Exclude words under Settings, Optimization. Osclass then leaves those files out of the master sheet. If icons still fail, add the font library URL keyword too.

Question: Why does TinyMCE error after Osclass JS minify?

Answer: Put a TinyMCE path keyword such as tiny in JS Exclude words under Settings, Optimization so Osclass does not merge that editor. TinyMCE often loads extra scripts from relative paths inside its folder. Exclude words match the script path. Test item publish after the exclude, not only the home page.

Question: Can I skip Osclass Optimization merge on the item page only?

Answer: Enter item in CSS Exclude pages or JS Exclude pages under Settings, Optimization. Home and search are valid page names too. Use this when one page breaks and the rest are fine. Do not turn the whole merge off for a single template bug. Save and reload that page only.

Question: What is the difference between CSS Exclude words and JS Exclude words in Osclass?

Answer: CSS Exclude words and JS Exclude words are separate lists in Settings, Optimization. Font Awesome belongs in CSS. TinyMCE belongs in JS. Exclude pages is also split per type. A word in the CSS list does not protect a JS file with the same name. Add the keyword that appears in the asset path.

Question: Where is the Osclass Settings Optimization screen versus Minify plugin?

Answer: Turn CSS and JS merge on in oc-admin, Settings, Optimization, then add exclude words and save. That is core Osclass, not an OsclassPoint Minify plugin ZIP. If the front office is blank, disable merge and check the exclude lists on that screen. Minify plugins are a separate product.

About the Author

My passion is building classifieds marketplaces, automating workflows, and turning messy data into useful products. From PHP, HTML, CSS, and JavaScript to Python, crawlers, imports, and SEO, I enjoy solving technical challenges and sharing lessons learned from real-world projects. Most ideas start with a problem, a cup of coffee, and a curiosity to see how far automation can go.
Osclass, PHP, JavaScript, CSS, Python
52 posts Publishing since 04/2018

Shopping cart
Support tickets Downloads Reviews Orders & Invoices Payments
Dashboard My profile Change password Download user data
Logout