Using WP Rocket and wondering what should be the settings to make the most out of it? If you are, I have got you covered.
WP Rocket is a simple tool, but to get the most out of it, you need to configure it properly. By configuring the appropriate settings, you can enhance the performance and maximize the benefits of this plugin.
In this article, I will guide you through the basics of WP Rocket and tell you WP Rocket best settings and practices that can help you pass the core web vitals.
I have used these settings to pass the core web vitals on gauravtiwari.org:
What is WP Rocket?
WP Rocket is a cache and website performance-enhancing WordPress plugin that can significantly improve your website's speed and core web vitals. WP Rocket is one of the best-selling premium WordPress plugins out there and costs $59 per year for a website.
If you are new to WP Rocket and don't have a license yet, you can get one here. Read my WP Rocket review for a proper understanding of this plugin and why it is the best WordPress cache plugin out there.
WP Rocket Best Settings
The configuration generally differs on different hosts.
WP Rocket support can help you configure the settings (and that's something I really liked about them) automatically.
But here is the configuration that I use.
Cache tab is super important to make your website fast.
In Dashboard → Cache tab, set things like this:
- Enable Cache for mobile devices: Checked ✅
- Separate Cache for mobile devices: Unchecked
- User Cache: Unchecked
- Cache Lifespan: 7 Days (Increase this if your website is mostly static that doesn't update regularly.)
- Save changes.
Cache settings are basically the first thing to start with. Here is how these will look.
Here is how you can do it.
- In CSS section, enable minify CSS. You will be prompted with a warning. Ignore that and check this box.
- Do not combine CSS files. Most of the hosting services are now HTTP/2 and combining CSS can hurt the performance.
- Choose to optimize CSS delivery and select Remove Unused CSS for the best performance. Please note that this step involves adding a good exclusion list (called CSS safelist). Download my CSS safelist
- Save changes.
Next comes the media tab, which helps you optimize the images and videos of your website properly.
I am using Jetpack's lazy load — while there is an option in WP Rocket for this as well. Lazy loading is a great way to boost your website speed.
With lazy loading, images load once users scroll to that section and don't if users don't. Also, you can enable the lazyload for iframes and videos to improve the performance even further.
Here are the recommended settings (if you are not using any other lazy load plugins):
- The first thing under this section is Lazy load and in that check "enable for images", "enable for iframes and videos" tab.
- Also, check the "replace the YouTube iframe with preview image" option.
- You can add any image or iframe code in this box if you don't want them to be lazy-loaded.
- Next, check the "add missing image dimensions" option under the image dimensions section. This improves cumulative layout shift errors in core web vitals.
You can enable preload so that WP Rocket creates HTML copies of your posts and pages to serve to readers.
It is my favorite feature of this plugin which helps you load your website like a cheetah.
Here's how you can do it.
- Activate preloading — Checked
- Enable link preloading — Checked.
- Prefetch DNS requests — In this box, you can prefetch external sites' resources like fonts, stylesheets etc. I use Typekit fonts on this site, so I'll enter
//use.typekit.netas a value in the box.
- Preload fonts — Enter any woff/wof2/otf/ttf fonts that your theme loads to improve performance. These fonts can be icon-fonts like font awesome, custom theme fonts etc.
Again, here are my WP Rocket Preload settings:
In the advanced rules tab of WP Rocket, you can fine-tune the settings that you have done till now.
- The first section is "never cache URLs" where you can add the URLs of your website that you don't want to cache ever.
- Next is the "never cache cookies section" where you can add cookies on your website which you don't want to cache.
- The third section is "never cache user agent" where you can add user-agent strings which you don't want to cache.
- The next setting is "always purge URLs" where you can add the link of the pages of your website which you always want to purge after every update.
- The last section is "cache query strings" where you can add query strings that you always want to cache.
If you are a complete beginner then I would recommend leaving this section as it is.
The database tab in WP Rocket is the place from where you can clean all garbage from your website's database and make it faster.
You can check the options which you want to clean from your website's database.
I would recommend these options to get cleaned from your database
- Trashed posts
- Spam comments
- Trashed comments
- Expired transients
Also, don't forget to check the "scheduled automatic cleanup option" and put it on weekly frequency.
This means that your database would be cleaned automatically every week.
In the CDN tab, you can easily connect any CDN with your WP Rocket plugin.
Also, you can check out this plugin's own CDN Rocket CDN if you haven't bought any CDN yet but are planning to do so.
However, if you are using any CDN, first check the "enable content delivery network" option and put the CDN CNAME here.
Also, if you want to exclude any specific URL(s) from your CDN then you just have to put it here.
However, if you are using Cloudflare as a CDN then you don't have to put any CDN URL here. The configuration is a little different, which I will tell you how to configure it in a bit.
Next is the heartbeat tab which is pretty easy to configure.
First, check the "control heartbeat" option and put every option under the "reduce or disable heartbeat activity option" to reduce activity.
Don't disable it totally because it can break your theme and plugins on your website and click on save changes.
The addon's tab of WP rocket is for all those who want no stone to left unturned for your website's speed.
Here are all the add-ons in WP Rocket:
- Sucuri Security Add-on helps you clear the sucuri security cache automatically
- Varnish add-on purges the varnish cache each time your clear cache by WP Rocket so your content remains up to date.
- Cloudflare add-on helps you easily connect Cloudflare with WP Rocket which would make your website fast.
- WebP addon improves WebP image rendering and browser compatibility.
The most important add-on is Cloudflare one as many people are using Cloudflare as the CDN for their website.
First, turn on Cloudflare add-on from here and then click on the "modify options" button.
After that, you would redirect to another page where you first have to fill in your Cloudflare Global API key, account email, and zone ID.
Next, if you have a live website, then check only the optimal settings option.
Click on the "clear all Cloudflare cache files" button and at last click on save changes.
Image optimization, tools and tutorials tabs
There is nothing to do in the image optimization tab just you have to install the Imagify plugin which is also made by the makers of the WP Rocket cache plugin.
Next in the tools tab, you can export your WP Rocket settings, import any other website's WP Rocket settings to your website, or roll back to the previous version of this plugin.
And in the last tab, you will get tutorials that will help you configure the WP Rocket plugin easily.