These are the same WP Rocket settings I used to get this GTmetrix report.
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 (Heartbeat Control, plugins for hosting Google Fonts and Analytics locally, etc).
I will show you how to optimize fonts, the difference between CDNs (Cloudflare, RocketCDN, StackPath), configure Cloudflare settings and page rules, optimize third party requests using preload and prefetch, image optimization plugins, WebP images, and how to delete old plugin tables in your database which you can’t do with WP Rocket (we will use WP-Optimize for this).
I tried to make this tutorial as robust (and simple) as possible. But if you still need help configuring the WP Rocket settings, drop a comment with your questions or GTmetrix report.
- File Optimization
- Advanced Rules
- Image Optimization
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, but you don’t need it if you’re using Cloudflare. You can clear the cache or regenerate critical CSS if you make design/plugin changes but they don’t appear on your site.
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 lower 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
Combine Files – just like minify, enable and check your site for errors.
Optimize Google Fonts – this compresses 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/preload fonts in the Preload tab and be minimal with fonts/weights.
Exclude CSS – if for some reason a minification option messes up your site layout, locate the problematic file and add it here. See WP Rocket’s article on resolving issues with minification.
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.
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.
Disable Emojis – emojis slow down your site. You can also disable them under Settings → Writing → Formatting, then do not convert emoticons.
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.
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.
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.
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.
Or use this list of common domains to prefetch as a reference:
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, they have 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 – prevents 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.
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.
You should really just use Cloudflare’s free CDN, in which case you would change nameservers and don’t need to do anything in this tab (see the Cloudflare tab instead).
WP Rocket says you shouldn’t use RocketCDN on top of Cloudflare. And since WP Rocket uses StackPath’s data centers for RocketCDN (who only has around 32 data centers), you’re better off on Cloudflare who has 200 data centers and counting. More data centers = faster website.
That means there is nothing to do in WP Rocket’s CDN settings since CDN URLs don’t work with Cloudflare or RocketCDN (they’re specifically for StackPath, BunnyCDN, KeyCDN, etc).
Here’s the catch.
I’m using both Cloudflare and StackPath. Yeah, I’m going against advice not to use multiple CDNs, but it’s been working great and I’m offloading a ton of bandwidth to StackPath. While I don’t advise this and it’s not recommended by WP Rocket, it works for me. If you want to try this, sign up for StackPath, create a CDN site, then copy/paste your CDN URL into WP Rocket.
Grab your StackPath CDN URL:
Paste the CDN URL into WP Rocket:
Testing CDNs – since Cloudflare is set up differently and requires changing nameservers, the “content delivery network” in GTmetrix YSlow will be red (but 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.
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).
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.
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.
As mentioned earlier, Cloudflare is the only CDN you need which offloads a ton of bandwidth.
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 – 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.
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.
- Enable Brotli (Speed Settings)
- Enable and test Railgun (Speed Settings)
- Enable and test Rocket Loader (Speed Settings)
- Enable hotlink protection (Scrape Shield Settings)
- Setup page rules for WordPress (Page Rules Settings, below are the top 3 I recommend)
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.
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 on the previous version.
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 6 extra plugins to get those 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 incorporates:
- Database cleanup (built-in to WP Rocket, or use WP-Optimize)
- Heartbeat control (built-in to WP Rocket, or use Heartbeat Control)
- Lazy load images/videos (built-in to WP Rocket, or use WP YouTube Lyte)
- Host Google Analytics locally (built-in to WP Rocket, or use CAOS For Analytics)
- Host Google Fonts locally (built-in to WP Rocket, or use CAOS For Fonts)
- Integration with Cloudflare + other CDNs (built-in to WP Rocket, or use CDN Enabler)
I tested WP Rocket against 3 top free cache plugins and while they all do a great job, WP Rocket gave me the best results in Pingdom (.4s load times). Your cache plugin and hosting are 2 main speed factors so it’s definitely worth the $49. Configuring the right WP Rocket settings with Cloudflare + StackPath can fix over 20 items in Pingdom and GTmetrix. So let’s do that :)
The WP Rocket settings are WAY easier to configure than W3 Total Cache and they update the changelog regularly so you’ll actually get ongoing updates. If you have questions (or want to share your new load time), drop me a comment. WP Rocket also has documentation which I reference throughout the guide. Good luck – remember to benchmark those Pingdom scores!
Here are the Facebook polls:
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)
WP Fastest Cache (.527)
W3 Total Cache (.619)
Recommended Host: Cloudways
In case you were wondering what hosting I use, it’s Cloudways DigitalOcean.
Join the WordPress Hosting FB Group to see what real, unbiased people are saying. Look at Facebook polls and tweets of people who migrated and posted their server response times.
I signed up for 15+ different hosting plans and tested them with the identical website:
I would personally skip shared hosting since cloud hosting is exponentially faster. This is especially true if you’re on GoDaddy or EIG brands (eg. Bluehost and HostGator) and for resource-intensive websites running WooCommerce, WPML, page builders, or slow plugins.
There are plenty of migration results if you check Twitter and Facebook Groups. Avoid the bloggers promoting Bluehost and WP Engine because they have the highest commissions and do your research. Hosting is the #1 factor in WordPress’ optimization guide – very important!
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.
There are also video tutorials in the Tutorials tab to help configure your WP Rocket settings.
Tutorials I found the most helpful:
- Getting Started
- My Site Is Broken
- Hosting Compatibility
- Using WP Rocket With A CDN
- Using WP Rocket With Cloudflare
- Resolve 500 Internal Server Error
- Resolving Issues With Minification
- Using WordFence With WP Rocket
- NGINX Configuration For WP Rocket
- Using iThemes Security With WP Rocket
- How To Check If WP Rocket Is Caching Your Pages
🚀 What's the best way to configure WP Rocket?
The most important steps are to enable everything you can in the file optimization tab, set up CDNs like Cloudflare + StackPath, disable WordPress heartbeat, and activate any services you're using in the Add-Ons tab.
🚀 How do I add a CDN with WP Rocket?
If using Cloudflare, you will simply change nameservers. If using an external CDN like StackPath or KeyCDN, you will copy/paste your CDN URL into WP Rocket. If using RocketCDN (powered by StackPath), sign up through the prompt in 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 From My WordPress Speed Optimizer
Still need help with your GTmetrix report?
I’ve been working with Pronaya for 7 years (he’s the one who optimized my GTmetrix report). You can hire him by signing up for freelancer.com and searching for username bdkamol. Here is his full WordPress speed portfolio. He’s $40/hour from Bangladesh (so there is a time change) and you can email him at email@example.com. He also has a perfect 5 star review on his Freelancer profile. Serious inquiries only, and please don’t expect 100% scores if you’re using slow hosting, a bloated theme, and tons of heavy plugins. Please follow my speed guides first.
Here are some reviews on his profile:
So… how are those GTmetrix scores looking? Let me know in the comments!
See Also: How I Got 100% Scores In GTmetrix
If you found this tutorial helpful, a share is always appreciated :)