These are the same WP Rocket settings I used to get this GTmetrix report.
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 will send you a code.
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.
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
Combine Files – just like minify, enable and check your site for errors.
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.
“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.
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.
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.
Disable Emojis – emojis slow down your site. You can also disable them under Settings → Writing → Formatting then enable “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.
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.
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, 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.
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.
I recommend using RocketCDN instead of Cloudflare if you have the budget.
RocketCDN uses StackPath’s data centers which are usually faster and have better compatibility than Cloudflare. RocketCDN is $6.99/month (cheaper than buying StackPath directly at $10/month). Many people who setup Cloudflare actually see increased load times. WP Rocket says you shouldn’t use RocketCDN on top of Cloudflare – only use 1 single CDN.
WP Rocket’s CDN tab is only meant for setting up RocketCDN and other CDNs that use CDN URLs (such as KeyCDN or BunnyCDN). It’s not meant for setting up Cloudflare which requires changing nameservers and configuring the Cloudflare tab.
- Choose either RocketCDN (recommended) or Cloudflare
- Use the CDN tab for RocketCDN or Cloudflare tab for Cloudflare
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.
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.
This section is only if you’re using Cloudflare instead of RocketCDN or 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 – 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)
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.
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 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)
- Optimize Google Fonts (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
Hosting recommendations are usually garbage.
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).
Here’s what happened when I moved:
GTmetrix tests are always different, but even posts with a huge page 2.70MB page size and 96 requests can often load in under 2s. I’ll also take a 148ms time to first byte any day of the week. That post has 70+ images, 480 comments (showing Gravatars), Font Awesome, and Elementor.
The evidence is there:
I use Cloudways because:
- Even posts with a 2.70MB page size can load in under 2s
- DigitalOcean and Vultr HF are miles faster than shared hosting.
- It’s $10-$13/month (no yearly contracts or high renewal prices).
- Varnish, Redis, and memcached are all built-in for higher performance.
- You get to pick from DigitalOcean, Vultr HF, Linode, AWS, Google Cloud.
- 4.8/5 star TrustPilot rating and highly recommended in Facebook Groups.
- They have 25+ data centers between all their cloud hosting providers.
- No CPU issues like on SiteGround, Bluehost, and other shared hosting.
- SSL, staging, and backups are all very easy in the Cloudways dashboard.
- Support used to be average, but is now really good as reflected on TrustPilot.
- They offer a free migration but their Migrator plugin will also do the trick.
- Adding a server, migrating your site, and the dashboard is actually very easy.
- Mustasaam (their community manager) gave me peace of mind when moving.
- Only complaint is they need to add LiteSpeed servers to their list of providers.
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.
Just do your research and look at this Facebook thread.
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, setup RocketCDN or Cloudflare, 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 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 StackPath 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 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 firstname.lastname@example.org. 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 :)