Autoptimize closing in on W3 Total Cache

Fun fact; As per wordpress.org “popular plugins” ranking , Autoptimize is slowly but surely closing in on what used to be the go-to solution for Web Performance Optimization W3 Total Cache based on the “active installs” metric. Who would have thought? What a crazy ride …

Quick trick to disable Autoptimize on a page

Update 2021: no need for below “hack” anymore; you can configure Autoptimize on a per-page basis on the post/ page edit screen! See this blogpost on the metabox settings for some more info.


So suppose you have one page/ post which for whatever reason you don’t want Autoptimize to act on? Simply add this in the post content and AO will bail out;

Some extra info:

  • Make sure to use the “text”-editor, not the “visual” one as I did here to make sure the ode is escaped and thus visible
  • This bailing out was added 5 years ago to stop the PHP-generated xsl:stylesheet from Yoast SEO from being autoptmized, if I’m not mistaking Yoast generates the stylesheet differently now.
  • The xsl-tag is enclosed in a HTML comment wrapper to ensure it is not visible (except here, on purpose to escape the HTML tags so they are visible for you to see).