Identify and remove unused css across entire site

This post will show you a range of ways to detect and remove unused css from your site.

removing unused css will help your stylesheets load faster which, in turn will help your site load faster.

there are several ways to do this.

one way is to use a firefox extension : dust me selectors it can take a sitemap.xml and can scan your entire site. it will show you all the unused css from your stylesheet.

This Post Has 6 Comments

  1. Paolo

    Thank you, very interesting post. But i’ve some doubts about dust me selectors. It give a different result for each page…why?Anyway i love this blog’s theme! :D

    1. jonathan

      I never answered this comment, not sure why, but there is an answer: dust me selectors identifies the css thats not used on a per-page basis, so eg if you had a class of ‘info-box’ and only used that on one page of your site, then it would identify that as not used on every other page :)

  2. tolga

    I’ve used unused-css.com, it gives an output of the whole css file with lines through the unused code for manual removal. This can be very time consuming but they can do the removing for a fee.

  3. TeckDevil

    Unused CSS doesn’t seems good as a free user. And Dust Me Selector isn’t compatible with my firefox version. Any other option?

  4. Lee Moss82

    You think this would be a simple thing to do, this should most certainly be a feature of Dreamweaver and other text editors. I agree with you teckdevil. very annoying.

Leave a Reply