• Plugin Author Optimizing Matters

    (@optimizingmatters)


    When installing and activating Autoptimize, you might encounter issues with your site. Although frustrating and scary, these can generally be easily resolved by re-configuring Autoptimize and I’ll be happy to share how you can do that here.

    If the problem is limited to one (or two) page(s), go to that page’s edit screen and in the “Autoptimize this page” metabox simple disable “optimize this page” and forget about it (or you can be more specific by just disabling “optimize JS” or “optimize CSS” or “lazyload images” or …).

    If the problem is more widespread, then try to identify what is breaking things by just disabling CSS or JS or HTML or Image optimization (incl. lazyload). You might have to clear your page cache after a configuration change (depending on your setup this might be a caching plugin or on the server or at host level or at a 3rd party such as Sucuri or Cloudflare).

    If the problem goes away by disabling CSS optimization, reactivate it and

    1. If “aggregate CSS” and “also aggregate Inline CSS” are on, first try disabling “also aggregate inline CSS” and if still broken try also disabling “aggregate CSS”
    2. Try adding wp-content/themes to exclude the theme CSS from being optimized
    3. Try adding wp-content/plugins to exclude all plugins CSS from being optimized, if that works you can try narrowing it down further by excluding specific plugins e.g. wp-content/plugins/elementor

    If the problem goes away by disabling JS optimization, reactivate it and

    1. Check the browser console for relevant JavaScript errors (see this wordpress.org support article for info on how to do that)
    2. If you see “jQuery is not defined“-errors on the browser console, make sure wp-includes/js/jquery/jquery.min.js is not aggregated (add it to the JS optimization exclusion field) or asynced/ deferred in any way.
    3. If “aggregate JS” is active, try switching to “don’t aggregate but defer”, optionally with “also defer inline JS” on as well (in which case you can likely remove at least the default exclusions).
    4. Try adding wp-content/themes to exclude the theme JS from being optimized
    5. Try adding wp-content/plugins to exclude all plugins JS from being optimized, if that works you can try narrowing it down further by excluding specific plugins e.g. wp-content/plugins/elementor

    Image optimization or lazyload issues can be fixed by excluding the image(s) from those optimizations by either excluding (part) of the image path (e.g. wp-content/uploads/2022/10/whatever.jpg) or if the <img tag has a e.g. class attribute excluding by class-name (e.g. img-fancybox-hidden).

    If the problem is with HTML minification, just keep that off, it’s not very important. Obviously, if you have some of the options on the “Extra” tab active, try deactivating them one by one.

    If all of the above fails, there is always free quality support offered here on the wordpress.org Autoptimize support forums! 🙂

  • The topic ‘Autoptimize troubleshooting howto’ is closed to new replies.