Try Now

How to Remove Unused CSS

Removing unused CSS is a really useful feature, it helps in reducing the CSS being loaded on the WordPress websites, as there are many page builders which loads CSS which is not required to load the page.

Unused CSS Issue
  • In your WordPress admin go to SpeedyCache --> File Optimization.
  • Now enable Unused CSS option, and a popup will open which will ask you on how to load unused css, you can choose from the 3 options remove being the most aggressive one.
  • You can exclude some scripts of select some based on the need and then you can save it.

NOTE: Using Unused CSS and Critical CSS together is not recommended, as it will not provide significant performance benefits. Critical CSS is more beneficial if you are using a good page builder that keeps CSS lean by default. Unused CSS is more beneficial if your editor is loading unnecessary CSS.

It is best to try both to see which one improves your performance, as this note is a suggestion and not an absolute rule.

SpeedyCache extracts required CSS to render the pages and gives 3 options to handle the unused CSS, which are:-

  • Load the Unused CSS Asynchronously
  • Load on User Interaction
  • Remove All Unused CSS from the Page.

Removing is the most aggressive option, and results in faster speed of the page compared to the other 2 options.

Remove Unused CSS settings popup

 Other than that Unused CSS feature has 2 more options Exclude Stylesheets and Include selectors.

Exclude Stylesheets

You can exclude certain CSS files which you do not want to remove from your Page, you can either add the full URL of the CSS file you want to exclude or you can just enter the name of the file.

Include Selectors

In this options you can add the selectors you want to be added to the resultant Used CSS, which will be generated after removing the Unused CSS.

Unused CSS is a really useful feature to help improve the performance of the page as it remove unwanted CSS reducing the total size of the content browser need to download.

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list