The Ideal WP Rocket Settings For 2021 + Tips For CDNs, Fonts, Images, And Third Party Script Optimization: Latest Version 3.8.1

Need to configure the best WP Rocket Settings?

WP Rocket was rated #1 in numerous Facebook polls because it comes with more speed optimization features than any other cache plugin. That’s why it usually yields better results in GTmetrix, Pingdom, and PageSpeed Insights. It also means you don’t need to install a bunch of extra plugins for optimizing Google Fonts, Google Analytics, heartbeat, delaying JavaScript, etc.

This guide goes beyond configuring WP Rocket’s settings and goes into more detail about further optimizing fonts, third-party code, delaying JavaScript so you can do things like show Gravatars without impacting GTmetrix, which CDN to use, deleting old plugin tables, and using prefetching + preloading. If you still need help, drop a comment with your GTmetrix report URL.

If you haven’t bought WP Rocket yet, I would appreciate you using my affiliate link. I also donate a good chunk of my affiliate income to charity. You can get 10% off by going to their coupons page, sign up for their email list, and they’ll email you a coupon.


1. Dashboard

Leave both options off unless you want to be a beta tester or let WP Rocket collect your data anonymously which results in a (very small) performance decrease. RocketCDN is covered in the CDN section which I recommend using instead of Cloudflare. You can clear the cache or regenerate critical CSS if you make design/plugin changes but they don’t appear on your site.



2. Cache

These are good cache settings as long as you don’t use a plugin for your mobile website and don’t allow multiple users to login to your site (eg. bbPress). I increased cache lifespan from 10 to 24 so the cache doesn’t have to refresh as often, which saves a little bit on server resources.


Mobile Cache – enables caching for mobile devices. Only enable “separate cache files for mobile devices” if you use a plugin for your mobile website (like the free version of WP Touch).

User Cache – leave disabled unless you have multiple users logging into your website (bbPress for example) where there is user-specific content. It gives each user their own cached version.

Cache Lifespan – a lower number means the cache will refresh more frequently, but it consumes more resources. A cache lifespan with a higher number means it won’t refresh as frequently, but saves resources. Do you care more about your cache building frequently or saving server resources? Since I only publish a couple posts a week, I increased it to 24 hours.


3. File Optimization

All HTML, CSS, and JavaScript settings should be enabled individually while testing your site for visible errors. These are the file optimization settings I use which gave me the best results in GTmetrix, but you should be testing your GTmetrix report to check the impact of each setting.


Minify Files – enables minification of HTML, CSS, and JavaScript. Check your site for visible minification errors after enabling each one. If you see any, view your source code, find the problematic CSS or JavaScript files, and exclude them from being minified. That way, you still get the benefits on minification (just not for that file). Otherwise, they should all be enabled.

Combine Files – whether you should combine CSS and JavaScript files is debatable. On one hand, it may improve Lighthouse scores. On another, it can actually slow down or break your site. I still recommend enabling it especially for lighter sites, but the results need to be tested.

Exclude CSS + JS – if for some reason a minification option messes up your site layout, locate the problematic file and add it here. See WP Rocket’s post on resolving issues with minification.

Optimize CSS Delivery – your page will start loading without CSS styles which is a depreciated item in PageSpeed Insights. WP Rocket automatically generates this for you. WP Rocket says:

“By enabling these options you may see an improvement in your performance grade on GTmetrix, Pingdom Tools, and Google PageSpeed Insights. Results will vary from site to site. Always remember to test the effect on the speed of your site. “

Remove jQuery Migrate – removes the jQuery migrate file which automatically loads in WordPress (and creates an additional request) but is usually not needed on most websites.

Load JavaScript Deferred – loads JavaScript after the page has finished parsing.

Safe Mode For jQuery – only enable if you see errors on your website when enabling the previous option (load JavaScript deferred). This excludes the jQuery file from being deferred.

Delay JavaScript Execution – this feature alone reduced my blog’s load time by about 3s on each post by delaying comments and Gravatars (for example, to delay Gravatar loading, just add the word “Gravatar”). While WP Rocket delays loading until user interaction, the Flying Scripts plugin is similar but it creates a timeout period (in seconds) until the JavaScript is loaded. I still use Flying Scripts but you can test each one out yourself. It requires some testing, but delaying heavy JavaScript files like comments, Gravatars, or sharing buttons can greatly improve loads.


4. Media

Most sites should enable everything especially in the lazyload settings. If you use embedded YouTube videos on your site, replacing the YouTube iframe with a preview image can cut load times in half since videos are very heavy. You’ll also still need a plugin to create WebP images.

WP Rocket Media Settings

Lazy Load – delays loading of images, iframes, and videos until you scroll down the page and they become visible. This significantly reduces initial load times and HTTP requests, but constantly loading images as you scroll can be annoying (test it out for yourself). Always lazy load videos and replace iframes with a preview image since embedded videos are very heavy.

Pro tip on lazy loading videos in Elementor – Adam from WP Crafter made a YouTube video on using Elementor to load videos faster. When I tested it, the results were great. Not only was I able to embed videos with 0 GTmetrix errors, but I could also customize colors, play buttons, and overall branding of videos. Unfortunately my blog doesn’t use Elementor (only my pages), but I recommend following his video if yours does – especially if you see GTmetrix errors when enabling WP Rocket’s lazy loading.

Add Missing Image Dimensions – WP Rocket will add missing width + height attributes to HTML images which should fix nearly all specify image dimension errors in speed testing tools.

Disable WordPress Embeds – similar to Cloudflare’s hotlink prevention, it prevents other sites from embedding your content on their site which sucks up bandwidth and stresses your server.

WebP Caching – enable if you’re using WebP images. If you’re not using WebP images already, you should since they load faster and look nicer than JPEG + PNG. Using WebP also fixes the serve images in next-gen format item in PageSpeed Insights. You will still need a plugin that converts images to WebP. I use WebP Converter For Media plugin but Imagify, ShortPixel, and most image optimization plugins have an option to convert images to WebP (TingPNG does not unfortunately). Finally, check your image files in the source code to make sure they use .webp.


5. Preload

Preloading is done automatically by WP Rocket when you activate it with your XML sitemap. Prefetching and preloading fonts are especially important for optimizing fonts and third party scripts which you can find in the Reduce DNS Lookups section of your GTmetrix YSlow report.


Preloading – tell browsers to start fetching resources that will be needed soon.

Preload Links – according to WP Rocket’s article, this feature makes it so if a user hovers over, or touches, a link for 100ms or more, the HTML of that page will be fetched in the background, so that when they actually click the link, the page will appear to load nearly instantly.

Prefetch DNS Requests – run your site through GTmetrix and look at the Reduce DNS Lookups section in your YSlow report. You will see all third party scripts loading on your site which can be anything from Google Fonts to Google Analytics, Maps, ASense, Tag Manager, YouTube, or even social media platforms if you embed social posts or use social share buttons on your blog.

Third Party Usage

Grab all those URLs from your report and paste them into the Prefetch DNS Requests section of WP Rocket. This will help browsers anticipate those external requests and load them faster.


Preload Fonts – copy your font files from GTmetrix Waterfall (they have a tab for font files) and paste them in WP Rocket’s preload fonts field. Retest your website and they should load faster.



6. Advanced Rules

Advanced Rules are mainly for eCommerce sites, however WP Rocket is already compatible with most solutions like WooCommerce and BigCommerce. But if you’re having issues with cart widgets, caching, or something related to eCommerce, WP Rocket has documentation for that.

Otherwise, leave this blank.


Never Cache URLs – if you’re using an eCommerce shopping cart that is not supported by WP Rocket, add your cart and checkout pages here which will exclude these pages from the cache.

Never Cache Cookies – same principle as previous option only based on cookies.

Never Cache User Agents – prevent Googlebot or other user agents from caching pages.

Always Purge URLs – let’s say you have a blogroll on your homepage. If you create a new post, you want that homepage blogroll updated immediately by emptying the homepage cache. That’s what this setting does, however WP Rocket automatically clears the cache for your homepage, categories and tags once new content is created… so there is usually no need for this. But if there are other page’s cache you want cleared when new content is posted, add it.

Cache Query Strings – mainly used to cache search result pages + price filters on eCommerce.


7. Database

Scheduling database cleanups keeps your site and admin fast, just know what you’re deleting!


  • Revisions – old versions of your posts which are saved when you hit “Publish.”
  • Auto Drafts – automatically saved versions of your post if you don’t hit “Publish.”
  • Trashed Posts – posts and drafts you deleted.
  • Spam Comments – comments marked as spam.
  • Trashed Comments – comments marked as trash.
  • Expired Transients – transients that have expired and are still in your database.
  • All Transients – stores data that takes a long time to retrieve (eg. social counts on blogs).
  • Optimize Tables – optimizes database tables to run more efficiently.
  • Automatic Cleanup – how often you want WP Rocket to clean your database.

Delete Unused Plugin Tables (Not With WP Rocket) – one thing WP Rocket doesn’t do is let you go through your individual database tables and delete tables left behind by old plugins that aren’t installed anymore. I recommend installing WP-Optimize and going through your tables every so often, especially if you deleted plugins (plus it shows you the actual size of the tables). The tables that say “not installed” are the ones that were left behind by old, uninstalled plugins.



8. CDN

CDNs are great if you have visitors far away from your origin server. They mirror your site on multiple data centers which reduces the geographic distance between your server and visitors.

Which CDN is best?

  • BunnyCDN – higher performance CDN highly recommended in multiple Facebook Groups (see this thread, this thread, and this thread). Instructions require creating a pull zone then copy/paste your CDN URL into WP Rocket. Or just use the BunnyCDN plugin.
  • Cloudflare – free, but not a true CDN since Cloudflare doesn’t serve assets from a CDN URL. Great for smaller websites, however there are higher performance CDNs out there. If using Cloudflare, it’s worth $5/month for their APO. Be sure to add a cache everything page rule, enable WAF, hotlink protection, and set the browser cache expiration to 1 year.
  • RocketCDN – paid CDN, easiest to setup through WP Rocket, uses StackPath’s data centers, but RocketCDN doesn’t always perform well and can actually increase TTFBs.
  • Check Their Data Centers – CDNs have data centers all over the world. If one has data centers heavily concentrated in the area you want, that is something worth considering.

The CDN tab is for RocketCDN, BunnyCDN, and CDNs that use a CDN URL. It’s not for Cloudflare which requires changing nameservers then using the Cloudflare tab.

Step 1: Sign up for a CDN (I recommend BunnyCDN).

CDN Feedback

Step 2: Create a pull zone and choose the locations you want.

BunnyCDN Add Pull Zone

Step 3: Copy your CDN URL.

BunnyCDN Hostname

Step 4: Paste CDN URL into WP Rocket’s CDN CNAME(s) field.

WP Rocket CDN Settings 2021

Testing CDNs – since Cloudflare is set up differently and requires changing nameservers, the “content delivery network” in GTmetrix will still be red (but it will be green for other CDNs).  That doesn’t mean Cloudflare isn’t working; use the Claire Chrome Extension to make sure it is.

Exclude Files From CDN – lets you serve files locally instead of the CDN. Usually, these files come from plugins designed to disregard cross domain load. In most cases, there is no need.


  • {uploads_dir}/wpcf7_captcha/*
  • {uploads_dir}/imagerotator.swf
  • {plugins_dir}/wp-fb-autoconnect/facebook-platform/channel.html


9. Heartbeat

Instead of using the Heartbeat Control plugin, WP Rocket has it built-in.

The WordPress Heartbeat API tells you when other users are editing a page/post and shows you real-time plugin notifications. You usually want to disable Heartbeat completely, or at least reduce it, since it consumes resources and contributes to CPU overages (eg. on SiteGround).



10. Add-Ons

If you’re using any of these services, activate it’s add-on.


Google Tracking – fixes the “leverage browser caching” issue for Google Analytics in your GTmetrix report by hosting Google Analytics locally. If it’s still not 100%, use the Flying Analytics plugin. If you’re using Google Analytics, remember to optimize it in the Preload tab.

Facebook Pixel  – enable if using Facebook Pixel to host it locally. If you’re using Facebook Pixel, remember to optimize it in the Preload tab.

Varnish – configured automatically depending on whether your host uses Varnish (Cloudways, Flywheel, WP Engine). Otherwise if they don’t use Varnish, this will be disabled automatically.

Cloudflare – enable if using Cloudflare.

Synchronize Sucuri Cache – enable if using Sucuri. This automatically clears Sucuri’s cache whenever you clear WP Rocket’s cache which helps keep your content synchronized. For the Sucuri Firewall API Key (For Plugin), login to Sucuri here, select your website, go to the API tab, then copy your API Key (For Plugin) and paste in WP Rocket when you expand the Sucuri field.


11. Cloudflare

This section is only if you’re using Cloudflare instead of another CDN.


Sign up for Cloudflare and you will come to a page where they assign you 2 nameservers.


Change nameservers in your domain registrar to the one’s Cloudflare gave you.


Add your Cloudflare information to WP Rocket.


Global API Key and Zone ID are found in your Cloudflare dashboard.

Cloudflare Global API Key

  • Global API Key – found in your Cloudflare dashboard.
  • Account Email – same email you used to sign up for Cloudflare.
  • Zone ID – found in your Cloudflare dashboard.
  • Domain – your website’s domain name.
  • Development Mode – use when making a lot of code changes to your site.
  • Optimal Settings – activates optimal Cloudflare settings: minification, aggressive caching, and deactivates Rocket Loader for better compatibility. Most common issue is Rocket Loader, but I also noticed it turns on email decoding which made my GTmetrix report worse, so I don’t use this (and instead configured Cloudflare in their dashboard).
  • Relative Protocol – sometimes if people download files from your site, there are no contents in them. Leaving this option OFF will prevent this from happening.
  • Clear All Cloudflare Cache Files – do this after you’re done configuring WP Rocket.

Automatic Platform Optimization – definitely worth $5/month since dynanmic parts of your site (HTML) will also be cached which can result in much faster TTFBs. You can enable APO in your Cloudflare speed settings or by using the Cloudflare plugin. See their setup instructions.

Cloudflare Automatic Platform Optimization

Configure Cloudflare Settings In The Dashboard – a lot of people have been asking about Cloudflare’s dashboard and how to configure it. Here are the things I recommend you do.

Page Rule 1: Cache Everything And Force HTTPS – cache your website aggressively.



Page Rule 2: Secure The WordPress Admin And Bypass Cache – sets security level of the admin to high and bypasses Cloudflare’s cache in the admin, since you don’t want CDNs (or apps + performance features like Rocket Loader) running inside the admin.*


Page Rule 3: Decrease Bandwidth Of WP Uploads – since the content in your WP Uploads folder does not change frequently, increasing Edge Cache TTL to a month can save on bandwidth, since the WP Uploads folder cache won’t be refreshed as often.*


As I mentioned, Cloudflare won’t fix “content delivery network” in GTmetrix YSlow because of the way it’s set up. Instead, use the Claire Chrome Extension to ensure Cloudflare is working.


12. Image Optimization

WP Rocket recommends Imagify because it’s their plugin.

But even when you select lossless compression, it’s definitely not lossless and neither is ShortPixel. I used both for many months and switched to TinyPNG which I’m very happy with. The only thing about TinyPNG is that it doesn’t support WebP in which case you will need a plugin like WebP Converter For Media. But I find the quality is much better than with Imagify.



13. Tools

Import and export your WP Rocket settings, or rollback to the previous version of WP Rocket.


Export Settings – export your settings to use on multiple sites.

Import Settings – import your pre-configured settings here.

Rollback – if you update to a new version of WP Rocket and it causes issues, this will fall back to the previous version.

Enable Google Font Optimization – combines fonts into 1 single file, ensures text remains visible while loading fonts, and preconnects fonts (tells browsers you intend to load Google Fonts). Remember to prefetch and preload fonts in the Preload tab and be minimal number of fonts, weights, and Elementor font icons. All these have an impact on your font’s load times.


WP Rocket = #1 Rated Cache Plugin

WP Rocket comes with many features most cache plugins don’t (see below). That means if you were to use other cache plugins, you would need to install about 5-10 extra plugins to get these features when WP Rocket already has them built-in (more features, yet less plugins on your site). That’s also why WP Rocket yields better results in GTmetrix/Pingdom and is what I use.

WP Rocket includes:

Here are the Facebook polls:

Cache Plugin Poll 680

Cache Plugin Facebook Poll 680

WP Rocket vs. W3 Total Cache

What cache plugin do you use

Swift Performance vs WP Rocket

Best cache plugin poll

Best cache plugin facebook poll

Best cache plugin for WordPress

I tested WP Rocket, WP Fastest Cache, and W3 Total Cache… making sure all cache plugin settings were configured optimally. WP Rocket won BUT this with the lazy load feature turned ON. The other cache plugins do not have a lazy load option and when I turned lazy load off in WP Rocket, I got a .5s load time… the exact same as WP Fastest Cache. I didn’t see a huge difference when clicking through my pages – both loaded super quickly. I know Pingdom can show different load times during different tests, but I just wanted to share my own experience.

WP Rocket (.406)
Pingdom Page Speed Test

WP Fastest Cache (.527)
WP Fastest Cache Load Times

W3 Total Cache (.619)
W3 Total Cache Load Times


Cloudways: Who I Recommend For Hosting

Still have a slow TTFB in Lighthouse and KeyCDN?

Backlinko reported SiteGround had some of the slowest TTFBs (that’s why there are so many complaints about them in Facebook Groups) and GoDaddy/EIG are obviously not good choices. I highly recommend joining the WordPress Hosting Facebook Group to get unbiased feedback.

Most members (including myself) swear by Cloudways WordPress Hosting. Specifically their DigitalOcean or Vultr High Frequency plan which are comparable in terms of speed and price.

Do your research and look at this Facebook thread (or this one).

Yes, it’s a little more expensive at $10-$13/month, but we’re talking about speed here – not being cheap. With Cloudways, you have a choice of using DigitalOcean, Vultr High Frequency, Google Cloud, AWS, or Linode. These are worlds faster than shared hosting and can handle resource-intensive tasks much better (Elementor, Beaver, Divi, WooCommerce, AdSense, etc).

Cloudways makes it easy to test them out and see the difference in your load times: they do free migrations, monthly pricing, and a promo code to get 25% off your first 2 months: OMM25

What happened when I moved:

Cloudways Shoutout

What happened when numerous other people moved:

Cloudways Response Times


SiteGround vs Cloudways Migration

Changed To Cloudways

SiteGround to Cloudways Migration

Cloudways Performance

Cloudways Google PageSpeed

Cloudways DigitalOcean Page Speed

WPEngine To Cloudways

Cloudways Pingdom Load Times

New Cloudways Server

Cloudways PageSpeed Scores

DigitalOcean Pingdom Report

WP Engine To Cloudways

Cloudways Love

Cloudways vs SiteGround Post

Godaddy DigitalOcean Migration

Cloudways Facebook Review

Recent Facebook polls show a large shift in people moving away from lower quality hosts (especially SiteGround) to Cloudways, Kinsta, A2, and GridPane. Oh, how things have changed.

eCommerce Hosting Poll

Moving from SiteGround

Hosting Recommendation

Good managed WordPress host

SiteGround Alternatives

Elementor Hosting

Hosting Poll

SiteGround Alternative

Moving From WPX

Preferred Web Hosting

Favorite Web Hosting

Web Hosting France

VPS Cloud Hosting

Web hosting recommendations

This is a simple Pingdom test to measure TTFB + load times of 16 WordPress hosts. I installed the same Astra Starter Site on 16 hosting accounts (using separate domains) while measuring Pingdom load times for 1 week at 30 minute check intervals, as well as TTFB in various tools. Some domains are still live ( is hosted on a $10/month Cloudways DO plan and is on SiteGround GrowBig). I cancelled most accounts since it got expensive. Even when browsing through these 2 sites or running your own tests, you’ll see the difference.


Hosting Companies To Avoid

  • SiteGround – went downhill. Slowest TTFB reported by Backlinko, increased complaints about TTFBs in Facebook Groups, numerous other reasons why people are leaving them.
  • Bluehost – slow servers, EIG owned, rated poorly, only promoted by affiliates.
  • HostGator – also EIG owned with slow servers, rated poorly, and CPU limit issues.
  • GoDaddy – top malware hosting network worldwide, rated poorly with CPU limits.
  • Hostinger – they write fake reviews and vote for themselves in Facebook polls.
  • WP Engine – also not what it used to be, expensive and not even fast anymore.
  • *A2 Hosting – if you can’t afford Cloudways, A2 is still fast and uses LiteSpeed.

Affiliate Disclaimer – if you sign up for Cloudways using my affiliate link, I would seriously appreciate it. I don’t recommend bad hosting like many other affiliates. I also donate quite a bit to charity ($6,000 to GoFundMe so far) and your support would really help. I try to base my reviews not only from my experience, but real evidence from the overwhelming feedback in numerous Facebook Groups. It would mean a lot.


View My Full WordPress Speed Guide

Here’s my full WordPress speed guide, or watch my video. It’s a 42 minute video but I cover pretty much everything (timestamps in video description) and you will learn lots of good stuff.


FAQs / Documentation

I spent many hours digging through their documentation to make sure this tutorial uses the best WP Rocket settings, but they are still extremely helpful if you haven’t checked them out.

wp rocket documentation

There are also video tutorials in the Tutorials tab to help configure your WP Rocket settings.

wp rocket video tutorials

Tutorials I found the most helpful:

What's the best way to configure WP Rocket?

The most important steps are to enable everything you can in the file optimization tab, setup a CDN, disable WordPress heartbeat, and activate any services you're using in the Add-Ons tab.

How do I use a CDN with WP Rocket?

If using RocketCDN (powered by StackPath), sign up through the prompt in WP Rocket. If using Cloudflare, you will change nameservers. If using an external CDN like BunnyCDN or KeyCDN, you will copy/paste your CDN URL into WP Rocket.

Why was WP Rocket rated #1 in most Facebook polls?

It comes with many features other cache plugins don't have: database cleanup, heartbeat control, option for multiple CDNs, lazy loading, local Analytics, Facebook Pixel browser caching, and more. That's why WP Rocket usually yields the best results in GTmetrix.

Which image optimization plugin works best with WP Rocket?

Even though they recommend Imagify which is owned by WP Rocket, I use ShortPixel because I see virtually no quality loss and still get 100% for Optimize Images in GTmetrix.

What other speed optimization plugins do you need besides WP Rocket?

You still need an image optimization plugin like ShortPixel, font optimization (eg. OMGF), and I also recommend using Asset CleanUp or Perfmatters to selectively disable plugins.


Get Help Improving Load Times

Still need help with your speed?

I recently hired WP Johnny for this WordPress speed service and was instantly impressed (I’m not a developer, he is, and he has a tremendous skillset). He hard coded my header, menus, and footer so they don’t use Elementor and he’s in the middle of completely removing Elementor and replacing it with Gutenberg blocks (page builder removal). Whatever help you need, I’m sure he can do it. Johnny is well-known in the WordPress community for being a speed wizard.

WP Johnny Speed Service

So… how are those GTmetrix scores looking? Let me know in the comments!

See Also: My full WordPress speed optimization guide.

If you found this tutorial helpful, a share is always appreciated :)


Notify of
Oldest Most Voted
Inline Feedbacks
View all comments