Reduce Unused CSS in WordPress - Smaller Stylesheets Without Broken Layouts (2026)
Unused CSS is one of the most common PageSpeed warnings on WordPress sites. Themes, builders and plugins ship styles for every possible page, and each page uses only a fraction of them.
Why WordPress Sites Have So Much Unused CSS
Themes and plugins are built to work on thousands of different sites. A theme ships styles for every layout, widget and color option it supports. A page builder ships styles for every widget in its library. A slider plugin loads its styles on every page, even the ones without a slider.
Any one page uses a small slice of all that CSS. The rest still has to be downloaded and parsed before the browser can render, which is why "Reduce unused CSS" shows up so often in PageSpeed Insights.
Why Unused CSS Slows Your Page
CSS is render-blocking. The browser won't paint anything until it has downloaded and processed every stylesheet in the head, because it doesn't want to show content and then restyle it.
So the cost of unused CSS isn't just bandwidth. It's time the browser spends parsing rules it will never apply, while your visitor waits for the first paint. On a phone, with a slower processor, that cost is higher still.
Cutting unused CSS improves First Contentful Paint, often improves Largest Contentful Paint, and clears the "Reduce unused CSS" and "Render blocking requests" items in your report. See render-blocking resources for the wider picture.
How to Find Your Unused CSS
Check PageSpeed Insights
Open the "Reduce unused CSS" diagnostic to see which stylesheets contain the most unused bytes and their estimated savings.
Open Chrome's Coverage tab
In DevTools, open the Coverage panel and reload the page. Each CSS file shows how much of it was used, with unused rules highlighted in red.
Interact with the page
Open menus, tabs and popups while Coverage is recording. Rules that were unused on load may be needed after an interaction.
Note the source of each file
File paths reveal whether the CSS comes from your theme, your builder or a specific plugin.
One caution about the Coverage tab: it only reports what was used during your session. A rule that applies only on a different screen size, a logged-in state or a rare interaction will show as unused even though you need it. That's why manual purging based on Coverage alone is risky.
Method 1: Generate Used CSS Per Page
This is the most effective method on most WordPress sites. A plugin scans each page, works out which CSS rules it actually uses, and serves a slimmed-down stylesheet containing only those rules.
The savings can be dramatic on builder-based sites, because builders ship so much CSS. The trade-off is that the generated CSS can miss rules used only after interactions, which you handle with a safelist.
| Plugin | Feature Name | How It Works |
|---|---|---|
| WP Rocket | Remove Unused CSS | Generates used CSS per page in the background and serves it inline |
| LiteSpeed Cache | Generate UCSS | Uses QUIC.cloud services to generate unused-CSS-free files |
| FlyingPress | Remove Unused CSS | Generates used CSS per page |
| Perfmatters | Remove Unused CSS | Generates used CSS and loads the original stylesheet after interaction |
WP Rocket's Remove Unused CSS processes pages in the background through its cloud service, so it can take a little while for every page to be handled on a large site. Pages that haven't been processed yet are served with their normal CSS, so nothing breaks while it works.
Method 2: Unload Stylesheets Where They Aren't Needed
Some unused CSS comes from plugins loading their files on every page. A contact form plugin, a slider, a gallery or a WooCommerce widget may only be used on a few pages, yet its stylesheet loads everywhere.
Asset managers such as Perfmatters' Script Manager or Asset CleanUp let you disable a specific stylesheet on specific pages, or everywhere except where it's used. This removes the request entirely instead of trimming it.
It's a manual process and needs care: disable a file on a page where it's actually used, and that feature loses its styling. Work through one plugin at a time and check the affected pages after each change.
Method 3: Use Your Theme's and Builder's Own Settings
Many themes and builders now include options to load only the CSS a page needs. These are worth switching on before adding anything else, because they work at the source.
Elementor
Performance features in Elementor's settings load widget styles only when the widget is used and improve how assets load. See speeding up Elementor.
Divi
Divi's performance options include dynamic CSS, which generates only the styles a page uses. See speeding up Divi.
Block themes
Themes built for the block editor load block styles only for blocks used on the page, which already reduces unused CSS.
WooCommerce
WooCommerce styles load on most pages by default; asset managers can limit them to shop pages where appropriate.
If your builder's own option and a plugin's used-CSS feature are both active, test carefully. They usually work together, but combining two CSS-rewriting features can occasionally produce missing styles.
Unused CSS vs Critical CSS
These two techniques are often confused, and they solve the problem from opposite directions.
Removing unused CSS shrinks the full stylesheet down to what the page uses, then serves that smaller file. Critical CSS extracts only the rules needed for the visible part of the page, inlines them, and loads the full stylesheet later without blocking.
Removing unused CSS usually saves more bytes overall. Critical CSS can render the top of the page sooner while keeping every original rule available. You'd normally use one approach or the other, not both. See critical CSS in WordPress for how the second method works.
How Much Can You Expect to Save?
It depends heavily on your theme and builder. A lightweight block theme may have little unused CSS to begin with, so the gain is modest. A multipurpose theme with a page builder and several plugins can carry large stylesheets where most rules go unused on any given page, and that's where the biggest savings appear.
Your PageSpeed Insights report gives you an estimate before you start. Look at the estimated savings on the "Reduce unused CSS" diagnostic for your heaviest template, and use that to judge whether the change is worth the testing time.
A Worked Example: A Builder Landing Page
Take a landing page built with a page builder, using a multipurpose theme, a slider plugin and a form plugin. Coverage shows that most of the builder's stylesheet and most of the theme stylesheet go unused on this page.
The builder's own performance options are switched on first, which stops it loading styles for widgets the page doesn't use. Then a used-CSS feature generates a trimmed stylesheet for the page. The slider plugin's stylesheet is unloaded on every page except the homepage, where the slider actually appears.
After testing, the mobile menu is missing its open-state styles, because those classes are only added after a tap. Adding the menu's open-state class to the safelist fixes it. The result is a page that renders sooner, with no visible change for visitors.
Safelisting: Keeping the Styles You Need
A safelist tells your optimizer to always keep certain CSS selectors, even if they don't appear on the page during the scan. It's how you protect styles that only apply after an interaction.
Common things to safelist include mobile menu classes, active and open states for tabs and accordions, popup and modal classes, form validation messages, and classes added by JavaScript after load.
In WP Rocket, you'll find a CSS safelist field directly under the Remove Unused CSS option. Add the selectors you need, save, and the generated CSS is rebuilt with them included. Our broken layout guide shows how to find the missing selector when something looks wrong.
Testing After You Reduce Unused CSS
Missing styles don't always show up on the homepage. Build a short checklist and run through it after every change.
- Open the mobile menu and any dropdowns.
- Click through tabs, accordions and sliders.
- Trigger a popup or modal if your site uses them.
- Submit a form with an error to check validation styles.
- View a post, a page, an archive and, on stores, a product and the cart.
- Check the page logged out in a private window, since that's what visitors see.
If everything looks right, re-run PageSpeed Insights and compare the "Reduce unused CSS" savings and your FCP and LCP against your baseline.
How WP Rocket Handles Unused CSS
WP Rocket's Remove Unused CSS sits under Page Optimization, in the JavaScript & CSS settings, as one of the two "Optimize CSS delivery" methods. Once enabled, it generates used CSS for your pages in the background through WP Rocket's cloud service, then serves it inline from your site, removing the original stylesheets from the critical path.
The alternative option in the same setting, Load CSS Asynchronously, generates critical CSS instead. It's a good fallback if Remove Unused CSS causes styling issues you can't resolve with a safelist. You choose one or the other.
On builder-heavy sites, Remove Unused CSS is usually the setting that moves the score most. Combined with Delay JavaScript, it addresses the two biggest front-end bottlenecks on most WordPress pages. Our best WP Rocket settings guide covers the full setup.
Reduce Unused CSS in WordPress FAQ
Is it safe to remove unused CSS?
Yes, when it's done per page by a tool that keeps the original files as a fallback and supports a safelist. Manual purging based on a single Coverage scan is riskier, because it can't see interaction-only styles.
Why do I still see "Reduce unused CSS" after enabling a plugin?
Some CSS may still load from sources the plugin excludes, like third-party stylesheets, or pages may not have been processed yet. Clear the cache, wait for processing to finish, and re-test.
Does removing unused CSS help Core Web Vitals?
It mainly helps First Contentful Paint and Largest Contentful Paint by reducing render-blocking time. It doesn't directly affect INP or CLS.
Should I use Remove Unused CSS or Load CSS Asynchronously in WP Rocket?
Start with Remove Unused CSS, which usually saves more. Switch to Load CSS Asynchronously if you hit styling issues you can't fix with the safelist.
Can I remove unused CSS without a plugin?
You can unload stylesheets with code and hand-write slimmer CSS, but it's time-consuming and has to be redone when your theme or plugins update.