1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

unused css remover for wordpress

Discussion in 'Black Hat SEO' started by Marcink99, Sep 5, 2012.

  1. Marcink99

    Marcink99 Power Member

    Joined:
    Aug 23, 2010
    Messages:
    725
    Likes Received:
    99
    Does anyone have or know a tool that will automatically find unused css and generate new css for wordpress?
     
  2. bobred

    bobred Registered Member

    Joined:
    Dec 21, 2011
    Messages:
    98
    Likes Received:
    63
    Whilst not quite automatic, there is a firefox add on "css-usage" that you can use to visit a few pages on your site and it will record which css is used and which isn't.. Though you need to manually delete the CSS that it marks as unused....

    Once you've cleaned up your CSS, it's a good idea to run it through an online css compressor to clean/compress it even more :)
     
    • Thanks Thanks x 1
  3. martha2

    martha2 Newbie

    Joined:
    Apr 26, 2010
    Messages:
    15
    Likes Received:
    5
    It would be difficult to remove unused CSS since it's one big file that covers many different pages (category page, post page, homepage, archives, tag page, widgets, etc.) I wouldn't recommend doing this unless you know exactly which rules will be unused.

    As bobred pointed out in previous post, use a css compressor to get rid of unnecessary spaces and new lines. If you want to clean up unused rules because of the Google speed test tool, don't worry about it. Deleting couple of lines of "unnecessary" code won't make much difference.