The Ideal Autoptimize Settings


Autoptimize isn’t the best cache plugin (WP Rocket and Swift Performance are #1 in most Facebook polls taken by the WordPress Speed Up Facebook Group with 10,000+ members).

In fact, Autoptimize doesn’t even do caching. So why use it?

Because some hosts like Godaddy and WP Engine blacklist most cache plugins (since they have their own built-in caching system), but they don’t do things like optimize HTML, CSS, JavaScript, Google Fonts, or CDN (content delivery network). So while your host’s caching system might work well for caching, Autoptimize helps do the “rest” of the stuff (fixing items in GTmetrix + Pingdom). Avoid Google PageSpeed Insights as it doesn’t even measure load times.

Even the Autoptimize developer says on his plugin page, that it works best when combined with a cache plugin. I recommend Swift if you’re going the free route, and WP Rocket if you can do $49/year as it’s easier to configure (it’s also what I use and I have 100% scores in GTmetrix) since it comes with many features most cache plugins don’t (database cleanup, hosting Google Analyitcs code locally, heartbeat control, and integration with both Cloudflare + other CDNs). I have tutorials for WP RocketSwiftWP Fastest CacheW3TC, and even WP Super Cache.

So let’s configure the Autoptimize settings. I’ll also show you how to add a CDN (ideally both Cloudflare and StackPath) since each one has their own set of data centers, and more data centers = faster content delivery. CDNs are recommended in WordPress’ optimization guide.

Main Settings


Optimize HTML Code – enable (fixes minify items in GTmetrix).

Optimize JavaScript Code – enable (fixes JavaScript items in GTmetrix). Test your site after enabling this and check for errors, as optimizing JavaScript is notorious for them.

Optimize CSS Code – enable (fixes CSS items in GTmetrix). Test your site after enabling this.

CDN Base URL – this is where your CDN URL goes (instructions below). Cloudflare does not provide you with a CDN URL (you will change name servers instead) which I show you here. The CDN Base URL is specifically for StackPath, KeyCDN, and other CDNs (not Cloudflare). As I said, I suggest using both StackPath + Cloudflare as your CDN will have more data centers.

CDN Instructions
Step 1: Sign up for a CDN. I use StackPath who has 34+ data centers which are heavily located in the United States and is where most my visitors are. It’s $10/month with a free 30-day trial.


Step 2: In the StackPath dashboard, click the CDN tab, and create a StackPath CDN Site


*Copy your server IP address as it is needed in step 5 of this section.


Step 3: Paste your StackPath CDN URL into the CDN Base URL field of Autoptimize. You will need to add http:// or https:// at the beginning of the URL for it to work with Autoptimize…

Step 4: In StackPath go to CDN → Cache Settings, then click “Purge Everything”…


Step 5Whitelist your server IP address in StackPath (WAF → Firewall).


Step 6: Run your site in GTmetrix and “content delivery network” should be green in YSlow.

CDN GTmetrix YSlow

Extra Settings


Google Fonts – enable if using Google Fonts which slow down load times as they’re pulled from external resources (the Google Font library). I prefer the “combine and link in head” option since this improves load times without visibility seeing fonts load (which is what usually happens when loading asynchronously. Also test the last Google Font option “combine and load fonts asynchronously with webfont.js” and see which yields better results in GTmetrix.

Optimize Images – URLs on your website will be changed to point to ShortPixel’s CDN. This should not effect how they look as long as it’s lossless compression, but they will load faster.

Image Optimization Quality – enable lossless compression to avoid losing image quality.

Remove Emojis – enable (emojis are bad for load times).

Remove Query Strings From Static Resources – query strings are usually generated by plugins and cannot be fixed (in GTmetrix/Pingdom) simply be enabling this, but you can try. The better solution is to check your site for high CPU plugins and replace them with lightweight plugins. Most high CPU plugins include social sharing, gallery, page builders, related post, statistic, and live chat plugins. You should also delete all unnecessary plugins and clean the database (using a plugin like WP-Optimize) to clear tables left by uninstalled plugins.

Preconnect To 3rd Party Domains – helps browsers anticipate requests from external resources (Google Fonts, Analytics, Maps, Tag Manager, Amazon store, etc). These will usually appear as “minimize DNS lookups” in your Pingdom report, but below are common examples.


Async Javascript-Files – this means something is preventing above-the-fold content from loading fast. This tutorial on render blocking JavaScripts explains it well, but if you see JavaScript errors in GTmetrix and Pingdom, the Async JavaScipt plugin might do the trick.

Optimize YouTube Videos – if your site has videos, WP YouTube Lyte lazy loads them so they only load when users scroll down and click the play button, thus eliminating initial requests to YouTube’s servers. This can shave multiple seconds off loads times on content with videos, as they’re one of the heaviest elements on a page. WP Rocket and Swift Performance have this built-in to their settings, so you don’t need this if you use one of them as your cache plugin.

Now that we’re done configuring the Autoptimize settings, let’s move on to Cloudflare.


Autoptimize does not have any settings to add Cloudflare, but this is easy to setup. And you definitely should because this adds 154 more centers to your content delivery network (CDN).


Step 1. Sign up for Cloudflare and you will be prompted to add your site and begin a scan.


Step 2. Once the scan is done, select the free plan, then Cloudflare will take you through a set of pages. You will eventually be taken to a page where Cloudflare assign you 2 name servers.


Step 3. Do a Google search for “how to change name servers on SiteGround” (only search for your host), then follow their instructions. You will be copying the 2 name servers provided by Cloudflare and pasting them into a custom name servers option in your hosting cPanel…


Step 4. Grab your Cloudflare Global API Key (found in your Cloudflare profile) and enter it into Swift’s Cloudflare tab. Use the same email as your Cloudflare account, and enable auto purge which purges Cloudflare’s cache when Swift’s cache is cleared (so you don’t have to manually).


MaxCDN / StackPath
You can ignore these settings. StackPath bought MaxCDN and no longer uses an Alias, Consumer Key, or Secret. Simply create a StackPath CDN URL and enter it in the CDN tab.

  • MAXCDN Alias – outdated (use StackPath CDN URL).
  • MAXCDN Consumer Key – outdated (use StackPath CDN URL).
  • MAXCDN Consumer Secret – outdated (use StackPath CDN URL).

Cache Plugins (WP Rocket / Swift)

As I mentioned, Autoptimize works best when paired with a cache plugin. WP Rocket is usually the highest rated in recent Facebook polls and is $49/year. Swift Performance Lite is usually the best free cache plugin, and I have tutorials for configuring both WP Rocket and Swift Lite.


Hosting (SiteGround)

Join the WordPress Hosting and WordPress Speed Up Facebook Group to see what real, unbiased people are saying, since hosting is the #1 factor in the WordPress optimization guide.

I use SiteGround and have 200ms response times with 100% GTmetrix scores and .4s Pingdom load times. Do a hosting check, run your own tests, or click through my fast loading pages. They were rated the #1 host in 26 Facebook polls and are worlds better than EIG (BluehostHostGator), Godaddy, and other hosts who pack too many people on the same server. There have been plenty of people who migrated and posted results on Facebook and TwitterTweetafter tweetpost after postpoll after poll after poll, faster hosting will fix slow response times. They’re recommended by WordPress, do free migrations, and I use their semi-dedicated plan.

View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
Bluehost vs HostGator vs SiteGround
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
View Poll or Screenshot
Bluehost vs SiteGround
WordPress Web Host Poll
View Poll or Screenshot

People usually migrate because their speed technology can improve server response times by multiple seconds. Here are a few people who migrated to SiteGround and posted their results.

Switching To SiteGround
SiteGround Load Time Migration
Bluehost to SiteGround GTmetrix
HostGator To SiteGround
SiteGround GTmetrix
SiteGround Google PageSpeed Insights
100 Perfect Score On SiteGround
SiteGround Genesis
Speed Delivered By SiteGround
SiteGround GTmetrix Report
Reduced Load Times With SiteGround
New SiteGround Response Times
HostGator To SiteGround Migration
SiteGround Response Times On Joomla
Switched To SiteGround Hosting
SiteGround Rocket Imagify Combo
Joomla GTmetrix On SiteGround
SiteGround PageSpeed Insights
SiteGround On Joomla
SiteGround Reduced Load Times
SiteGround Speedy Hosting
New Pingdom Results On SiteGround
New SiteGround Response Time
SiteGround Response Time Improvement

I use SiteGround because…

  1. My GTmetrix + Pingdom report speak for themselves
  2. They use PHP 7.3, NGINX, HTTP/2, Cloudflare, fast speed technology
  3. Average load time is 1.3s, giving most people instant speed improvements
  4. They’re recommended by WordPress and Ivica from WordPress Speed Up
  5. Free Let’s Encrypt SSL, easy to use cPanel, and features for eCommerce
  6. Renewal prices are a price jump, but you can get 3 years of the promo price
  7. Always been known for great support (tickets usually answered in <10 min)
  8. I always get 100% uptimes but 99.99% is guaranteed (includes daily backups)
  9. They do free migrations, have a migrator plugin, and 30-day money back policy
  10. They’re based in Chicago (my hometown) and have 4 data centers to choose

Affiliate Disclaimer – if you sign up for SiteGround using my affiliate link I would genuinely appreciate it. Each year I donate $3,000 to GoFundMe campaigns (2018 was to feed the homeless, and 2017 was to Hurricane Harvey). Your support helps, and I know there are tons of affiliates out there. I try to make my reviews unbiased and backed by evidence in the form of Facebook pollstweets, and real conversations. If you don’t want to use it, here’s a non-affiliate link to SiteGround. Either way I truly believe they’re the best host and that your site will run faster/smoother… do your research on Google and Facebook groups and you’ll find most people say the same.

They have 3 plans:


Higher plans include more server resources (#1 factor in the WordPress optimization guide). Here’s the full comparison chart, but GrowBig gives you about 2x more server resources than StartUp, and GoGeek is semi-dedicated hosting which gives you even more. GrowBig and up comes with a free migration, staging, advanced caching, and ability to host multiple websites. GoGeek comes with priority support. Their cloud hosting is quite the price jump at $80/month.

You can see this on their features page


One of many threads…


Want To Know How I Got 100% Scores In GTmetrix?
See my full WordPress speed optimization guide which has over 38 tips in fixing GTmetrix/Pingdom items including upgrading to PHP 7, serve scaled images, specifying image dimensions, database cleanup, AMP, hosting Google Analytics locally, WP Disable, and others.

Questions? Drop me a line!

About the author

Add comment

By Ru

Recent Posts