Autoptimize is a popular free WordPress performance plugin that improves the load time of your website by combining and minifying assets on your website such as CSS and JS files. While you could use the minify tool within a caching plugin such as W3 Total Cache Autoptimize is much easier, and less prone to breakage as it uses a different minify engine than W3.

How Does It Work?

Autoptimize works by scanning your website for CSS and JS files. It will then aggregate and minify those files in the order that it finds them. Autoptimize also does the bare bones minification such as removing white space and comments. This prevents breakage but also allows the files to be very small. While some tools attempt to do optimizations such as Google’s Closure compiler these are prone to breaking JavaScript files.

Autoptimize also makes sure to group files by media type in order to prevent your Print CSS from overwriting your regular CSS files (this being said you should just be using the @media for print CSS).  You can overwrite this though through their extended API.

Sounds Complicated!

It’s actually extremely simple but if things don’t work perfectly out of the box then you are going to need some help.

Autoptimize Plugin



HTML Optimization: It will compress your on-page HTML by removing comments and white space. Keep in mind that it will ignore inline CSS and JS though.

JavaScript Optimization: In addition to just aggregating JS files and minifying the JS files there are several advanced options. You can force the JS into the head, aggregate inline JS (bad idea in most cases), exclude files (if one file is to be ignored such as JQuery you can exclude it here), or add Try Catch Wrapping. Try Catch Wrapping is a last resort before simply excluding the file, never leave it enabled if you don’t have too and in most cases simply don’t use it.

CSS Optimization: In addition to combining and compressing your CSS files there are many more advanced options to help fine tune your site even more. You can generate data: URLs for your images which turns background images into their base64 equivalent (makes it to where you don’t download the image and saves an HTTP request). You can remove Google fonts as well if you do not need them for your website, as well as aggregate inline CSS, and defer the critical CSS for your website.

If you are using a CDN you can safely set it up through the plugin by providing a URL that the assets will be served from then Autoptimize takes care of the rest.


Autoptimize is a wonderful addition to any webmaster or developer that is looking to improve the performance of their website and while it is a simple to get started tool it can truly do wonders in the hands of someone who learns it inside and out. Through the powerful and expansive API to the CDN integration Autoptimize is a must have tool for any serious website.


Please enter your comment!
Please enter your name here