The short fix
- Test the page and note the stylesheets with the most unused CSS.
- Work out which plugin or theme loads each file from its address.
- Stop loading stylesheets on pages that don’t use them, such as form or slider styles.
- Turn on one used-CSS feature (WP Rocket, Perfmatters or LiteSpeed Cache), not two.
- Check menus, product options, cart and checkout logged out on a phone, then re-test.
What PageSpeed Insights is telling you
Reduce unused CSS appears under Diagnostics in PageSpeed Insights. It lists the stylesheets that carry a lot of rules the page didn’t use while loading, with each file’s size and the part that could be saved. Lighthouse’s own description sums up the fix: remove unused rules, and defer CSS that the first screen doesn’t need.
In a FlashMax report the same problem is the card Styles the page never uses. It shows up when a page carries 50 KB or more of unused styles.
“Unused” means unused on this page, at this screen size, during load. Rules for other pages, the desktop layout, hover effects or the cart drawer all count as unused here. So the number will never reach zero, and it doesn’t need to.
Why it slows the page
Stylesheets in the page head block rendering until they have downloaded and been read, unused rules included. A heavy stylesheet therefore delays First Contentful Paint and Largest Contentful Paint, which together make up 35% of the Lighthouse score, and wastes mobile data.
The diagnostic itself isn’t scored. The score improves when FCP and LCP improve, which is why removing a whole stylesheet usually helps more than shaving a few rules off one.
How common it is
In our study of 40,951 WooCommerce stores, 81.7% (33,454 stores) loaded 50 KB or more of unused styles on the home page. Their median phone score was 50, against 63 for stores without the problem. That’s a correlation, not proof: stores with one problem usually have others too. The median store loaded about 166 KB of CSS in the phone test. Method and caveats: WooCommerce speed study.
How to find the stylesheets
- FlashMax: paste your address into the free speed test; the card Styles the page never uses lists the files behind it.
- PageSpeed Insights: open Diagnostics → Reduce unused CSS on the Mobile tab and start with the files that have the largest saving.
- Chrome DevTools Coverage: open DevTools, open the Command Menu, type
coverage, choose Show Coverage and click Reload. Each file gets a bar: green is used bytes, gray is unused. Recording continues while you click around, so open the menu and the cart to see what they really use.
Then match each file to its owner by the address: /wp-content/plugins/plugin-name/ is a plugin, /wp-content/themes/theme-name/ your theme, /wp-includes/css/dist/block-library/ WordPress’s block styles, and /wp-content/uploads/elementor/css/ Elementor.
How to fix it on WordPress and WooCommerce
Chrome’s advice for WordPress is short: reduce, or switch, the plugins that load unused CSS. In practice that means three steps, in this order.
1. Load stylesheets only where they’re used
This is the cleanest fix because it removes CSS instead of hiding it. Common candidates on a store: contact-form styles on pages without a form, slider styles on pages without a slider, WooCommerce styles on blog posts, and styles from plugins you no longer use. Our unused JavaScript guide covers a plugin that unloads CSS and JavaScript per page.
For developers: WooCommerce loads three stylesheets, woocommerce-general, woocommerce-layout and woocommerce-smallscreen, and lets you filter them with woocommerce_enqueue_styles. This keeps them on store pages only (put it in a child theme’s functions.php or a code-snippets plugin):
add_filter( 'woocommerce_enqueue_styles', function ( $styles ) {
// Keep WooCommerce styles on store pages, and on the home page if it shows products.
if ( is_woocommerce() || is_cart() || is_checkout() || is_account_page() || is_front_page() ) {
return $styles;
}
return array();
} );Before you rely on it, check every page that shows products through blocks or shortcodes, such as landing pages or blog posts with product grids.
2. Turn on one used-CSS feature
These features work out which rules each page uses, put only those in the page, and load the original stylesheets later or not at all.
- WP Rocket: File Optimization tab → Optimize CSS delivery → Remove Unused CSS. The used CSS is generated per URL in the background, so a page gets it after its first visit or preload. Selectors that must always stay go in the CSS safelist. If the feature breaks your layout, WP Rocket suggests Load CSS Asynchronously instead.
- Perfmatters: CSS → Remove Unused CSS. By default the used CSS is inlined and the original stylesheets are delayed until the visitor interacts; you can store the used CSS as a file instead and load the originals async. Add anything that loses its style to Excluded Stylesheets or Excluded Selectors.
- LiteSpeed Cache: Page Optimization → CSS Settings → Generate UCSS, which runs on the QUIC.cloud service. Keep needed selectors with UCSS Selector Allowlist on the Tuning CSS tab; list the base selector, not
:hovervariants.
Use only one of them. WP Rocket switches its feature off when Perfmatters’ Remove Unused CSS is active, and Perfmatters asks you not to run two at the same time.
3. Update WordPress and your page builder
Since WordPress 6.9, classic themes load each core block’s styles only on pages that use that block. WordPress measured an average of 45% less CSS on its Sample Page across the bundled classic themes. Elementor 3.24 began loading every widget’s styles in separate files, only where the widget is used, and reported up to 668 KB less CSS per page for sites that hadn’t used its earlier experiment. Updating is often the cheapest fix there is.
Shopify and hand-built sites
Shopify: you can’t change the platform’s own files. What you control is the theme’s CSS and the styles apps add. Remove apps you no longer use, check the theme for code they left behind, and avoid adding sections you don’t need. Our unused JavaScript guide covers leftover app code.
Hand-built sites: use the Coverage panel to find dead rules and delete them at the source. Split CSS by page type, for example a small global file plus separate product, cart and checkout files, so each page downloads only its own. Tools that strip unused selectors at build time only see classes written in your templates, so classes added by JavaScript need to be safelisted.
Mistakes to avoid
- Losing styles Lighthouse never sees. Mobile menu, hover effects, cart drawer, quick view, product variations, checkout errors: test each one after turning on a used-CSS feature.
- Testing while logged in. WP Rocket doesn’t serve its used CSS to logged-in users when User Cache is on, and Perfmatters generates used CSS for logged-out visits. Test in a private or incognito window, as Perfmatters suggests.
- Forgetting to clear used CSS after design changes. Perfmatters says to clear used CSS and every cache layer after changes. WP Rocket clears a page’s used CSS when you edit it and regenerates all of it every 30 days.
- Combining all CSS into one file. Perfmatters calls combining CSS a deprecated technique since HTTP/2. One big file is also more likely to be mostly unused on any single page.
- Removing files site-wide by guesswork. A stylesheet flagged on the home page may be needed elsewhere. Unload per page and keep a note of what you changed.
How to check the fix worked
- Clear the plugin, server and CDN caches. For used-CSS features, visit the page once (or preload it) so the used CSS gets generated.
- Re-test two or three times and compare the unused CSS total and FCP, not a single score; lab results vary.
- On a phone, logged out, click through the menu, search, a product with options, add to cart, the cart and checkout.
- Field data in Search Console and CrUX covers the previous 28 days, so give it about four weeks.
Questions people ask
Why does PageSpeed say my CSS is unused when the site needs it?
Lighthouse checks one page, at one screen size, while it loads, without clicking anything. Styles for other pages, the desktop layout, menus and the cart count as unused in that test. Aim to cut the big, obvious waste, not to reach zero.
Is Remove Unused CSS safe on a WooCommerce store?
Usually, if you test. After turning it on, check product variations, the mini cart, cart and checkout while logged out, and use the plugin’s safelist or exclusions for anything that loses its style.
Should I remove the WordPress block library CSS?
Not by hand if any page uses blocks, because their layout depends on it. Update to WordPress 6.9 or later instead: classic themes then load block styles only for the blocks on each page.
What is the difference between unused CSS and render-blocking CSS?
Unused CSS is about size: rules downloaded but not used. Render-blocking is about timing: stylesheets that must load before anything shows. A used-CSS feature helps with both, because it puts the small used part in the page and moves the original files out of the way.
Sources
- Remove unused CSS (Lighthouse) — Chrome for Developers
- Coverage: Find unused JavaScript and CSS — Chrome DevTools
- WordPress 6.9 Frontend Performance Field Guide — Make WordPress Core
- Remove Unused CSS — WP Rocket docs
- How to remove unused CSS in WordPress — Perfmatters docs
- Page Optimization — LiteSpeed Cache for WordPress docs
- Disable the default stylesheet — WooCommerce docs
- Elementor 3.24 Developers Update — Elementor Developers
Rather have it done?
The FlashMax team fixes the issues in your report, on a copy first, and shows the before-and-after.
See the speed optimization service