# Removing unused CSS with Purgecss/UnCSS

**URL:** https://discourse.roots.io/t/removing-unused-css-with-purgecss-uncss/11586
**Category:** sage
**Tags:** sage9
**Created:** 2018-02-12T08:53:35Z
**Posts:** 27
**Showing post:** 3 of 27

## Post 3 by @knowler — 2018-02-12T14:40:17Z

In writing this, I tried to use The SEO Framework’s `sitemap.xml`, however, since the goal for this post was to try and do it in a way that was quick and easy to setup, I didn’t want to include a ton of extra dependencies (e.g. xml to json converters, sitemap generators, etc).

An idea I had was to add a pre-build script using `wget` to spider the entire site, ignoring `robots.txt` (i.e. `-e robots=off`), however, it was getting too convoluted for this post.

I like the idea of having a tool check your actual codebase (Purgecss) vs. the generated version of your website (UnCSS), as I do want all of my template code in my theme directory (not in the database). Of course, there are pitfalls, but if you didn’t need to theme any plugins, it’s gold.

---

_[View the full topic](https://discourse.roots.io/t/removing-unused-css-with-purgecss-uncss/11586)._
