How to Remove Unused CSS on Your WordPress Site

Remove Unused CSS WordPress

When you are auditing your WordPress website speed with the performance audit tools such as Lighthouse or GTmetrix, one of the most challenging recommendations that will show is to remove unused CSS that is being loaded on your WordPress site.

There are several WordPress plugins that claim to remove unused CSS but many fail. Here are the two easy plugins to be able to remove unused CSS that is loading on your WordPress website.

1. Core Web Vitals & PageSpeed Booster

Core Web Vitals & PageSpeed Booster

Core Web Vitals & PageSpeed Booster – WordPress plugin

The Core Web Vitals & PageSpeed Booster is a new WordPress performance plugin developed by the team at Magazine3.

Once you have installed and activated the plugin on your site it will add a new admin menu item called; Core Web Vitals

Core Web Vitals & PageSpeed Booster

Remove Unused CSS – Core Web Vitals & PageSpeed Booster

Navigate to the CSS tab of the plugin settings, you will see a toggle to remove unused CSS. You can also clear the CSS cache from here.

The plugin also includes options for:

  • Lazy loading
  • Minification
  • Google Fonts optimization
  • Delaying JavaScript execution
  • Basic cache and more…

Give a try to this new buddy and don’t forget to share your experience in the comments below.

2. Asset Cleanup

Asset CleanUp: Page Speed Booster - WordPress Plugin

Asset CleanUp: Page Speed Booster – WordPress Plugin

The second plugin to remove unused CSS is Asset CleanUp which will not only allow you to disable CSS but also the JavaScript that is being loaded by active plugins and the active theme from loading on specific pages on your WordPress site.

You will need to have the Asset CleanUp plugin installed and activated on your site and then on the edit a Page or Post screen, the Asset Cleanup: CSS & JavaScript Manager / Page Options section will show all of the CSS and JavaScript files that are being loaded on it.

Asset CleanUp Page Options

Asset CleanUp Page Options

In the Manage CSS & JS page option, set the CSS that should not be loading on the page or post to be unloaded and when you save and refresh that page in your browser. The disabled/removed unused CSS assets will no longer be loading on the page or post.

  • The Asset CleanUp plugin also includes features such as:
  • Optimize CSS to minify and combine
  • Optimize JavaScript to be able to minify and combine
  • Disable emojis, embeds, disable dash icons, block library, comment reply site-wide, and so on.

You can also remove unused elements from the head section of your site such as RSD, windows live, REST API link tag, WordPress meta tag, main RSS feed link and the comment RSS feed link.

There is also a pro version of the Asset CleanUp plugin if you need a number of additional options for your site.

Using either the Core Web Vitals or Asset CleanUp plugins on your site will make it easy to be able to remove unused CSS on your site for a performance gain.

Useful links

Comments are closed.

Looking for something?

Privacy laws apply to businesses that collect personal information. Since no personal information is collected by the MainWP plugins, no privacy laws apply to the MainWP plugins. This includes GDPR, UK DPA 2018, PIPEDA, Australia Privacy Act 1988, LGPD, PIPL, and other privacy laws.
Donata Stroink-Skillrud
Donata Stroink-Skillrud
President of Agency Attorneys