Autoptimize concatenates all scripts and styles, minifies and compresses them, adds expires headers, and caches them. It also moves styles to the page head and scripts to the footer.

This WordPress plugin even minifies the HTML code itself, making your page extremely lightweight. Also, there are advanced options available that allow you to tailor Autoptimize to your website’s specific needs.

  1. Log into your WordPress Admin panel.
  2. Hover your mouse over “Plugins” and click “Add New.”
  3. In the “Search” box, type “Autoptimize” and click “Search Plugins.”
  4. Click “Install Now.” A prompt dialog will open and ask if you are sure you want to install the plugin. Click “OK.” After the plugin is installed, click “Activate Plugin.”
  5. Navigate to “Settings → Autoptimize.”
  6. Click on the “Show advanced settings” button.
  7. In the HTML section, enable “Optimize HTML Code” and “Keep HTML comments.”

  8. In the “Javascript Options” section, enable “Optimize JavaScript Code” and “Force JavaScript in head.” If your .js breaks to script error, you can try enabling “Add try-catch wrapping” as well.

  9. In the “CSS Options” section, enable “Optimize CSS Code.” You can also inline your CSS so pages load faster.
    NOTE: This option is great for smaller sites, but it can actually slow down sites that have a lot of traffic.

    There is also the option to exclude certain CSS code from the plugin.

    NOTE: DO NOT enable the “Generate data: URIs for images” option. This will result in a decreased number of requests when loading your website, but will force images to be served through your origin instead of your CDN.

  10. Enter your CDN URL in the “CDN Base URL” field, and click on the “Save Changes and Empty Cache” button. Use your CDN URL instead of “http://foo.bar.netdna-cdn.com.”

    NOTE: The CDN is activated upon entering the CDN blog root directory (e.g. http://cdn.example.com/). If that URL is present, it will be used for all Autoptimize-generated files (i.e. aggregated CSS and JS), including background-images in the CSS (when not using data-uri’s).

    If you want your uploaded images to be on the CDN as well, you can change the upload_url_path in your WordPress configuration (/wp-admin/options.php) to the target CDN upload directory (e.g. http://cdn.example.net/wordpress/wp-content/uploads/).

    Do take into consideration that this only works for images uploaded from that point onwards, not for images that were already uploaded.

Autoptimize is compatible with plugins like WP Super Cache and CDN Linker which provide a more developed rewrite functionality. Note that only one of these plugins should have CDN enabled due to possible rewrite issues.

​If you have any questions about using this plugin effectively, feel free to start a live chat or leave a comment below.

  • Hi Team,

    Is it necessary to install Autoptimize when we already W3 total cache installed and configured with MAXCDN as per your recommended W3 Total Cache configurations? Thanks to clarify

    • Hello,

      You don’t need Autoptimize on your web site if you already have W3 Total Cache installed and configured correctly. If you have any additional questions, feel free to reach out to us at support [at] maxcdn [dot] com.

      • Thanks for the reply. Very helpful

  • Hi Team,
    I have a small site. I installed WP super cache for him. But when I install Autoptimize and try to configure, error 500 appear. Are they not compatible???

  • Annapurna Agrawal

    Hi,
    i have activated both, w3tc and ao. But the issue i am facing is the cache size of ao plugin.
    what should i do that is clears automatically.

  • giststudents

    Pls am new to blogging. How can I locate my own blog CDN?

  • Howard Milstein

    Hi
    Recently had some site problems with autoptimize. Checked main settings and emptied cache. Then saw HTML was still checked afterward. Did it again… broke my navigation FONT style change.. later couldn’t login to admin.. redirect…(fixed finally by my themeshop).. what did I ( or the program ) do wrong?
    Thanks
    PS. First time no problem; but wondered why HTML was not corrected ( still remained checked..
    Second time saved right after …all went to hell!)

  • This is still not solving my problem

  • Sinar Hadi Wijaya

    Thanks, after try this article my gtmetrix result increase and better loading time. Thanks

  • Thank you , am getting good result on gmatrix and pingdom

  • Owolabi Mijioyime Ojo ThankGod

    I used it on my site o3schools.com but am not sure on how to get my CDN url

  • Muhammad Maaz

    HI
    can you please tell me what this domain dose
    waiting

  • ManiVasagam

    Thanks for the article. But you didn’t mention for those who use SSL feature.

    But if i’ve enabled Shared SSL on maxcdn for my site https://mykalvi.com ,i got different CDN URL.

    So, in this case, i’ve to use this new SSL CDN URL in the autoptimize plugin right ?

    Thanks.

    • Kimmy Shinjiru

      Hi ManiVasagam, have u found solution yet for SSL ? we also having same issue, the method id fine to resolve the render blocking css and js but it blocked the wordpress sliders and also images

  • I have a doubt can i able to use maxcdn on blogger blogs, this is my bog(http://www.aufastupdates.com/ ) please check and tell…

  • Prakash kumar

    Txs for your lovely article and i implement this on my site https://keralalotteryresults.lastbenches.com and i have a doubt that wordpress login is useful for seo optimization

  • If I install Autoptimize Plugin in my website then the error in GTmetrix tool that is “Use CDN network” will be solved?