The plugin works best in combination with a cache plugin (e.g. WP Rocket, WP Fastest Cache, W3 Total Cache), a hosting company that offers packages with server-level caching available (e.g. Cloudways) or a service like Cloudflare that has page caching enabled.
If using Asset CleanUp, enable Test Mode in the settings which lets you test removing CSS without it breaking your site.
- Remove CSS Where It Doesn’t Need To Load
- Disable contact form plugin on pages that don’t have a contact form.
- Disable affiliate link management plugin on pages that don’t use aff links.
- Disable social sharing plugin on all pages (since it’s usually for blog posts).
- Disable unused functionality in your page builder (see this post for Elementor).
If using Perfmatters, enable the script manager in the settings. There are also settings for removing bloat, browser resource hints, and other settings that can improve speed.
Some plugins, page builders, and CSS files load across your entire WordPress site. If some files are only being used in specific areas of your site, disable them everywhere else. Depending on which asset loading plugin you use, you can disable CSS files everywhere except current URLs, posts, pages, disable them on a single URL or use regex to disable CSS files using URL patterns.
RapidLoad extends Autoptimize to automatically find CSS that’s not being used, then prevents it from loading on the page. By reducing the total CSS file size and page weight, RapidLoad can significantly reduce load times. It even improves the performance of other optimizing plugins and extensions, like CriticalCSS.
4. Critical CSS Generation
- Enable optimize CSS delivery.
- Check for “rocket-critical-CSS” in your source code to make sure it’s working.
- If it’s not working, regenerate critical CSS in WP Rocket and page builders (if using one).
- Scan your website using PurifyCSS.
- Download the combined, purified, and minified CSS.
- Paste the code into your cache plugin (fallback critical CSS).
- Exclude files from CSS delivery using WP Rocket’s helper plugin.
- If those don’t work, Gijo Varghese’s FlyingPress plugin has great reviews.
- UnCSS – a more tedious CSS removal tool that requires you to copy/paste your HTML and CSS into their tool and download it. KeyCDN says it’s more accurate than PurgeCSS since it looks at actual web pages rather than individual files but is also slower and requires more manual setup.
- PurifyCSS – free CSS removal tool. Add your website, click “clean up CSS” with minify output turned on. Once the scan is complete, download your combined, purified, and minified CSS file.
- Unused-CSS – freemium CSS removal tool. You can run a page through the tool and it tells you much CSS will be removed (and the percentage of CSS selectors used). You will need to give them your email and sign up for a paid plan if you want to download the CSS for your entire site.
7. Serve CSS From A CDN – Content Delivery Network
- Without CDN: https://nagamarketing.com/style.css
- With CDN: http://cdn.nagamarketing.com/style.css
If you’re using Cloudways you don’t need to do anything in Perfmatters. Cloudways is different than traditional CDN providers and sits between your site and the public internet. Traffic is automatically routed through Cloudways, and it doesn’t require a custom CDN URL.
8. Avoid Slow Plugins That Inject CSS
There are some Plugins like Sliders, Builder, forms inject CSS and it loads your entire site. You can view the list of slow Plugins, WP Hive Chrome Extension, or use the Query Monitor plugin By John Blackbourn to find the slowest plugins.