Plugin Directory


Autoptimize speeds up your website and helps you save bandwidth by aggregating and minimizing JS, CSS and HTML.


First of all; Happy holidays, all the best for 2015!!

  • New: support for alternative cache-directory and file-prefix as requested by a.o. Jassi Bacha, Cluster666 and Baris Unver.
  • Improvement: hard-exclude all linked-data json objects (script type=application/ld+json)
  • Improvement: several filters added to the API, e.g. to alter optimized HTML, CSS or JS
  • Bugfix: set Autoptimize priority back from 11 to 2 (as previously) to avoid some pages not being optimized (thanks to CaveatLector for investigating & reporting)
  • Bugfix (in YUI-CSS-compressor-PHP-port): don't convert bools to percentages in rotate3D-transforms (cfr. bugreport on Github)
  • Bugfix: background images with a space in the path didn't load, reported by johnh10.
  • Bugfix: SVG image with fill:url broken after CSS optimization as reported by Tkama
  • Updated translation for Swedish, new translation for Ukrainian by Zanatoly of SebWeo.com
  • Updated readme.txt
  • Confirmed working with WordPress 4.1



  • "Inline and defer CSS" allows one to specify which "above the fold CSS" should be inlined, while the normal optimized CSS is deferred.
  • Inlined Base64-encoded background Images will now be cached as well and the threshold for inlining these images has been bumped up to 4096 bytes (from 2560).
  • Separate cache-directories for CSS and JS in /wp-content/cache/autoptimize, which should result in faster cache pruning (and in some cases possibly faster serving of individual aggregated files).
  • CSS is now added before the -tag, JS before (and after when forced in head). This can be overridden in the API.
  • Some usability improvements of the administration-page
  • Multiple hooks added to the API a.o. filters to not aggregate inline CSS or JS and filters to aggregate but not minify CSS or JS.
  • Updated translations for Dutch, French, German, Persian and Polish and new translations for Brazilian Portuguese (thanks to Leonardo Antonioli) and Turkish (kudo's Baris Unver)
  • Multiple bugfixes & improvements
  • Tested with WordPress 4.0 rc3


  • Updated to lastest version of CSS minification component
  • Improvement: for multi-sites the cache is now written to seperate directories, avoiding one site to clean out the cache for the entire installation. Code contributed by Joern Lund, kudo's Joern!!
  • Improvement: add WordPress plugin header to autoptimize_helper.php_example to make it easier to enable it as a module
  • Improvement: nonce and post_id are added to default configuration for JS exclusion
  • Improvement: explicitely exclude wp-admin from being Autoptimized
  • Bugfix: plupload.min.js, syntaxhighlighter and "adsbygoogle" are excluded from JS aggregation.
  • Bugfix: avoid double closing body-tags when Autoptimize adds JS to HTML as reported by Can
  • Bugfix: make .htaccess compatible with both Apache 2.2 and 2.4 (http://wordpress.org/support/topic/feature-request-support-generating-htaccess-files-for-apache-24?replies=3)


  • Bugfix: code in inline JS (or CSS) can be wrapped inside HTML-comments, but these got removed since 1.8.2 as part of a bugfix.



  • Improvement: more graceful failure when minifier classes exist but method does not, based on bug-report by Franck160
  • Improvement: deferred CSS is also outputted in noscript-tags
  • Improvement: differentiate between Apache version in .htaccess file as suggested by iMadalin
  • Improvement: also aggregate protocol-less CSS/JS URI's (as suggested by Ross)
  • Improvement: disable autoptimization based on parameter in querystring (for debugging)
  • Bugfix: some CSS-imports were not being aggregated/ minified
  • Bugfix: add CSS before to avoid breakage when title includes other attributes (e.g. itemscope)
  • Bugfix: make sure javascript or css between comments is not aggregated as reported by Milap Gajjar
  • Tested with WordPress 3.9 (beta 1)
  • Updates in FAQ


  • bugfix: CSS in conditional comments was not excluded from aggregation as reported by Rolf and bottapress



  • improvement: remove cache + options on uninstall as requested by Gingerbreadmen
  • improvement: set .htaccess to allow PHP execution in wp-content/cache/autoptimize when saving optimized files as PHP, as suggested by (David Mottershead of bermuda4u.com)[http://www.bermuda4u.com/] but forbid PHP execution when saving aggregated script/css as static files (except for multisite).
  • bugfix: avoid Yoast SEO sitemaps going blank (due optimization of Yoast's dynamically built XML/XSL) as reported by Vance Hallman and Armand Hadife. More info on this issue can be found on my blog.
  • smaller changes to readme.txt


  • improvement: extra checks in CSS @import-handling + move import rules to top of CSS if not imported successfully, based a.o. on bug reports by ozum and by Peter Stolwijk
  • improvement: check if JS and CSS minifier classes exist and only load if they don't to avoid possible conflicts with other themes or plugins that already loaded minifiers
  • tested and approved for WordPress 3.8 (beta1)




  • New: disable autoptimizatoin by putting part of your HTML, JS or CSS in between noptimize-tags, e.g.;
<!--noptimize--><script>alert('this will not get autoptimized');</script><!--/noptimize-->
  • Added extra check to prevent plugin-files being called outside of WordPress as suggested in this good article on security.
  • Added small notice to be displayed after installation/ activation to ask user to configure the plugin as well.
  • Added Persian translation, thanks to Hamed T.


  • new javascript-debug option to force the aggregated javascript file in the head-section of the HTML instead of at the bottom
  • YUI compression & CDN are now deprecated functionality that will be removed in 1.7.0



  • fix for IE-hacks with javascript inside, causing javascript breakage (as seen in Sampression theme) as reported by Takahiro of hiskip.com
  • fix for escaping problem of imported css causing css breakage (as seen in Sampression theme) as reported by Takahiro as well
  • fix to parse imports with syntax @import 'custom.css' not being parsed (as seen in Arras theme), again as reported by Takahiro
  • fix for complex media types in media-attribute as reported by jvwisssen
  • fix for disappearing background-images that were already datauri's as reported by will.blaschko
  • fix not to strip out comments in HTML needed by WP Super Cache or W3 Total Cache (e.g. mfunc)
  • added check to clean cache on upgrade
  • updated FAQ in readme with information on troubleshooting and support
  • tested with WordPress 3.6 beta


  • Yet another emergency bugfix I'm afraid: apache_request_headers (again in config/delayed.php) is only available on ... Apache (duh), breaking non-Apache systems such as ngnix, Lighttpd and MS IIS badly. Reported by multiple users, thanks all!


  • fixed stupid typo in config/delayed.php which broke things badly (april fools-wise); strpos instead of str_pos as reported by Takahiro.


  • You can now specify scripts that should not be Autoptimized in the admin page. Just add the names (or part of the path) of the scripts in a comma-seperated list and that JavaScript-file will remain untouched by Autoptimize.
  • Added support for ETag and LastModified (essentially for a better pagespeed score, as the files are explicitely cacheable for 1 year)
  • Autoptimizing for logged in users is enabled again
  • Autoptimize now creates an index.html in wp-content/cache/autoptimize to prevent snooping (as proposed by Chris)
  • bugfix: removed all deprecated functions (reported by Hypolythe and diff by Heiko Adams, thanks guys!)
  • bugfix for HTTPS-problem as reported by dbs121
  • bugfix for breakage with unusual WordPress directory layout as reported by Josef from blog-it-solutions.de.


  • bugfix: add CSS before opening title-tag instead of after closing title, to avoid CSS being loaded in wrong order, as reported by fotofashion and blogitsolutions (thanks guys)


  • first bugfix release by futtta, thanks for a great plugin Turl!
  • misc bug fixes, a.o. support for Twenty Twelve theme, admin bar problem in WP3.5, data-uri breaking CSS file naming


  • Add support for inline style tags with CSS media
  • Fix WordPress top bar


  • Add workaround for TinyMCEComments
  • Add workaround for asynchronous Google Analytics


  • Add workaround for Chitika ads.
  • Add workaround for LinkWithin widget.
  • Belorussian translation


  • Add workarounds for amazon and fastclick
  • Add workaround for Comment Form Quicktags
  • Fix issue with Vipers Video Quicktags
  • Fix a bug in where some scripts that shouldn't be moved were moved
  • Fix a bug in where the config page wouldn't appear
  • Fix @import handling
  • Implement an option to disable js/css gzipping
  • Implement CDN functionality
  • Implement data: URI generation for images
  • Support YUI CSS/JS Compressor
  • Performance increases
  • Handle WP Super Cache's cache files better
  • Update translations


  • Add workaround for whos.among.us
  • Support preserving HTML Comments.
  • Implement "delayed cache compression"
  • French translation
  • Update Spanish translation


  • Add workaround for networkedblogs.
  • Add workarounds for histats and statscounter
  • Add workaround for smowtion and infolinks.
  • Add workaround for Featured Content Gallery
  • Simplified Chinese translation
  • Update Spanish Translation
  • Modify the cache system so it uses wp-content/cache/
  • Add a clear cache button


  • Add workaround for Vipers Video Quicktags
  • Support tags without media.
  • Take even more precautions so we don't break urls in CSS
  • Support adding try-catch wrappings to JavaScript code
  • Add workaround for WordPress.com Stats
  • Fix a bug in where the tags wouldn't move
  • Update translation template
  • Update Spanish translation


  • Add fix for DISQUS Comment System.


  • Add workaround for mybloglog, blogcatalog, tweetmeme and Google CSE


  • Support localization
  • Fix the move and don't move system (again)
  • Improve url detection in CSS
  • Support looking for scripts and styles on just the header
  • Fix an issue with data: uris getting modified
  • Spanish translation


  • Write plugin description in English
  • Set default config to everything off
  • Add link from plugins page to options page
  • Fix problems with scripts that shouldn't be moved and were moved all the same


  • Disable CSS media on @imports - caused an infinite loop


  • Support CSS media
  • Fix an issue in the IE Hacks preservation mechanism
  • Fix an issue with some urls getting broken in CSS


  • First released version.

Requires: 2.7 or higher
Compatible up to: 4.1.1
Last Updated: 2015-1-24
Active Installs: 60,000+


4.8 out of 5 stars


53 of 76 support threads in the last two months have been resolved.

Got something to say? Need help?



5 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,3,3 83,6,5 100,1,1
100,3,3 86,7,6
100,1,1 100,1,1
75,4,3 100,5,5
100,6,6 50,2,1 100,2,2 100,6,6 100,5,5 100,3,3 100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,11,11
100,2,2 100,6,6 100,4,4
100,4,4 100,2,2 100,2,2 100,3,3
100,2,2 100,1,1 90,10,9 100,2,2 100,4,4 100,1,1
67,3,2 100,9,9 100,1,1
100,2,2 50,2,1 100,15,15
100,5,5 100,1,1
100,3,3 85,13,11