The LiteSpeed Cache plugin can minify and combine the CSS and JavaScript files on your WordPress site, which trims file sizes and helps with "eliminate render-blocking resources" warnings in PageSpeed Insights. These options give real speed gains, but they are also the settings most likely to break a layout, menu or form. This guide shows how to minify CSS and JavaScript with LiteSpeed Cache safely: one setting at a time, with a quick test after each change.
Before you start
- Page caching is a separate feature. Your pages are already cached by the server. The options in this guide only change how CSS and JS files are delivered.
- Take a backup with WP Toolkit or JetBackup 5, or at least export your plugin settings in LiteSpeed Cache > Toolbox > Import/Export > Export Settings.
- Test in a private (incognito) window. By default the optimized files are what visitors see, and a private window shows you the site the way a visitor does.
- Some options, such as Generate UCSS and critical CSS, use LiteSpeed's QUIC.cloud online service. You don't need them to minify or combine files.
Where the CSS and JS settings are
In your WordPress dashboard, go to LiteSpeed Cache > Page Optimization. The tabs you need are:
| Tab | Settings |
|---|---|
| CSS Settings | CSS Minify, CSS Combine, Load CSS Asynchronously, Generate UCSS |
| JS Settings | JS Minify, JS Combine, Load JS Deferred |
| HTML Settings | HTML Minify, Remove WordPress Emoji, Load Google Fonts Asynchronously |
| Tuning / Tuning CSS | JS Excludes, JS Deferred/Delayed Excludes, URI Excludes, CSS Excludes |
The Advanced preset in LiteSpeed Cache > Presets turns on several of these at once. If you'd rather know exactly which setting caused a problem, turn them on by hand as below.
How to minify and combine CSS and JavaScript step by step
Change one setting, click Save Changes, purge the cache, then test. Purge from the LiteSpeed icon in the admin bar (Purge All) or from LiteSpeed Cache > Toolbox > Purge.
- HTML Minify (HTML Settings tab). Low risk. Turn it on, save, purge, test.
- CSS Minify (CSS Settings tab). Low risk. Save, purge, test.
- JS Minify (JS Settings tab). Usually safe. Save, purge, test.
- CSS Combine. Medium risk: combining can change the order styles load in. Save, purge, test.
- JS Combine. Highest risk of the group. Scripts that expect to load in a particular order (sliders, page builders, cookie banners) can stop working. Save, purge, test carefully.
- Load JS Deferred. Choose Deferred first. Deferred runs scripts as soon as the HTML has finished loading; Delayed waits until the visitor scrolls, clicks or types, which scores well but can make menus or pop-ups feel slow to react. Save, purge, test.
What to test each time: the home page and a couple of inner pages, the mobile menu, contact forms (actually submit one), sliders and galleries, and the cart and checkout if you run a shop. Check on a phone as well as a computer.
Because the Instant Access Internet Services server supports HTTP/2 and HTTP/3, combining files matters less than it used to. If CSS or JS Combine causes any trouble, it's fine to leave combine off and keep minify on.
If something breaks: exclude the file instead of giving up
First confirm it's the optimization. Open your page in a private window with ?LSCWP_CTRL=before_optm added to the end of the address, for example https://example.com/?LSCWP_CTRL=before_optm. That shows the page without CSS/JS optimization. If it looks right there, one of the settings above is the cause.
- Turn off the setting you changed last, save and purge. If the problem goes away, that setting is the culprit.
- To keep the setting on, find the file that doesn't like it. In the
before_optmview, open developer tools (F12), go to the Network tab, filter by CSS or JS, and note the file names (for examplejquery.min.jsor a slider plugin's script). - Add a likely file to the right exclude box, one per line:
- JavaScript broken by minify or combine: Page Optimization > Tuning > JS Excludes.
- JavaScript broken by deferred or delayed loading: Tuning > JS Deferred/Delayed Excludes.
- CSS problems: Page Optimization > Tuning CSS > CSS Excludes.
- One page that won't cooperate (a checkout or booking page, for example): add its path to Tuning > URI Excludes.
- Save, purge all, and test again. Repeat until the page works.
A partial file name is enough, for example jquery.min.js or elementor.
Common questions
Why do I only see the problem when logged out?
Visitors get the cached, optimized version. If Optimize for Guest Only (Tuning tab) is on, logged-in users see the plain files. Always test in a private window.
My changes to CSS don't show up
The plugin serves stored copies of optimized files. After editing theme CSS, purge with Purge All, or in Toolbox > Purge use Purge All - CSS/JS.
Should I turn on everything for a better PageSpeed score?
No. A working site matters more than a perfect score. Keep the settings that help and don't break anything, and leave the rest off.
Related guides
- Best LiteSpeed Cache Settings for WordPress (Using Presets)
- How to Clear (Purge) the LiteSpeed Cache in WordPress
- How to Fix Website Problems Caused by LiteSpeed Cache
- How to Check If LiteSpeed Cache Is Working on Your Site
- How to Back Up and Restore WordPress in WP Toolkit
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
