Plugin Directory

Test out the new Plugin Directory and let us know what you think.


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


  • new: Autoptimize now appears in admin-toolbar with an easy view on cache size and the possibility to purge the cache (pass false to autoptimize_filter_toolbar_show filter to disable), a big thanks to Pablo Custo for his hard work on this nice feature!
  • new: An extra "More Optimization"-tab is shown (can be hidden with ´autoptimize_filter_show_partner_tabs´-filter) with information about related optimization tools- and services.
  • new: If cache size becomes too big, a mail will be sent to the site admin (pass false to autoptimize_filter_cachecheck_sendmail filter to disable or pass alternative email to the autoptimize_filter_cachecheck_mailto filter to change email-address)
  • new: power-users can enable Autoptimize to pre-gzip the autoptimized files by passing true to autoptimize_filter_cache_create_static_gzip, kudo's to (Draikin)[https://github.com/Draikin] for this!
  • improvement: admin GUI updated (again; thanks Pablo!) with some responsiveness added in the mix (not showing the right hand column on smaller screen-sizes)
  • improvement: settings-screen now accepts protocol-relative URL for CDN base URL
  • improvement: new (smarter) defaults for JS (don't force in head + exclude jquery.js) and CSS optimization (include inline CSS)
  • Misc. bugfixes & small improvements (see commit-log on GitHub)
  • Minimal version updated from 2.7 (!) to 4.0
  • Tested and confirmed working on WordPress 4.6


  • bugfix: disallow moving non-aggregated JS by default (can be re-enabled by passing false to the autoptimize_filter_js_unmovable)
  • bugfix: hook autoptimize_action_cachepurged into init to avoid ugly error-message for ZenCache (Comet Cache) users
  • bugfix to allow for Autoptimize to work with PHP 5.2 (although you really should upgrade)


  • Improvement: Autoptimize now also tries to purge WP Engine cache when AO's cache is cleared
  • Improvement: for AMP pages (which are pretty optimized anyway) Autoptimize will not optimize to avoid issues with e.g. "inline & defer" and with AO adding attributes to link-tags that are not allowed in the subset of HTML that AMP is
  • Improvement: refactored the page cache purging mechanism (removing duplicate code, now nicely hooking into AO's own autoptimize_action_cachepurged action)
  • Improvement: Re-enable functionality to move non-aggregated JS if "also aggregate inline JS" is active (can be disabled with autoptimize_filter_js_unmovable filter)
  • Improvement: script tags with data-noptimize attribute will be excluded from optimization
  • Bugfix: Better support for renamed wp-content directories
  • Bugfix: Multiple fixes for late-injected CSS/ JS (changes in those files were not always picked up, fonts or background images were not being CDN'ed, ...)
  • Misc. other fixes & improvements, go read the commit-log on GitHub if you're that curious
  • Tested & confirmed working with WordPress 4.5 (beta 3)


  • On average 30% faster minification (more info in this blogpost)!
  • New: Option to (de-)activate aggregation of inline JS and CSS.
  • New: Option to remove Google Fonts.
  • New: Cache-size will be checked daily and a notice will be shown on wp-admin if cache size goes over 512 MB (can be changed by filter).
  • New: Small autoptimized CSS (less then 256 characters, can be changed by filter) will be inlined instead of linked.
  • New in API: filters to declare a JS and CSS whitelist, where only files in that whitelist are autoptimized and all others are left untouched.
  • New in API: filters to declare removable CSS and JS, upon which Autoptimize will simply delete that code (emoji CSS/JS for example, if you prefer not to dequeue them).
  • New in API: filter to move fonts to CDN as well.
  • lots of small and bigger bugfixes, I won't bother you with a full list but have a look at the commmit log on GitHub.
  • tested and confirmed working with PHP7




  • improvement: more intelligent CDN-replacement logic, thanks Squazz for reporting and testing
  • improvement: allow strings (comments) to be excluded from HTML-optimization (comment removal)
  • improvement: changed priority with which AO gets triggered by WordPress, solving JS not being aggregated when NextGen Galleries is active, with great help from msebald
  • improvement: extra JS exclude-strings: gist.github.com, text/html, text/template, wp-slimstat.min.js, _stq, nonce, post_id (the latter two were removed from the "manual" exclude list on the settings-page)
  • new in API: autoptimize_filter_html_exclude, autoptimize_filter_css_defer, autoptimize_filter_css_inline, autoptimize_filter_base_replace_cdn, autopitmize_filter_js_noptimize, autopitmize_filter_css_noptimize, autopitmize_filter_html_noptimize
  • bugfix: remove some PHP notices, as reported by dimitrov.adrian
  • bugfix: make sure HTML-optimalization does not gobble a space before a cite as proposed by ecdltf
  • bugfix: cleaning the cache did not work on non-default directories as encountered by NoahJ Champion
  • upgraded to yui compressor php port 2.4.8-4
  • added arabic translation, thanks to the ekleel team
  • tested with WordPress 4.2 beta 3


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).
  • Autoptimized CSS is now injected 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 separate 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-separated 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: 4.0 or higher
Compatible up to: 4.7.2
Last Updated: 2 months ago
Active Installs: 200,000+


4.7 out of 5 stars


90 of 154 support threads in the last two months have been marked resolved.

Got something to say? Need help?



6 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
86,7,6 100,1,1 100,3,3
90,10,9 100,2,2
100,5,5 100,8,8
100,11,11 100,8,8 100,4,4
100,9,9 100,1,1
100,6,6 100,4,4