WP Rocket is one of the best caching and optimization plugins available for WordPress. It comes only as a premium version and undoubtedly it will improve your site’s speed to next level. However, you have to properly setup the plugin to pass Core Web Vitals in Google PageSpeed Insights and improve your site’s search engine ranking as speed is officially one of the ranking factors for Google. If you have purchased the plugin or planning to purchase, here are the optimized settings for WP Rocket to speed up your site.
I am using this plugin for more than 4 years as you can see in the below invoice details and it works well in SiteGround Cloud hosing. So, the settings explained here are based on my experience and updated for the latest version of WP Rocket.
WP Rocket Settings
After installing and activating the plugin, go to “Settings > WP Rocket” section to view all available options for speed optimization. The plugin’s setting pages contain three columns:
- Left sidebar containing various tabs to navigate and configure the plugin settings.
- Middle section containing detailed options for each tab.
- Right sidebar showing quick actions or tutorials.
If you feel the area is congested, go to any of the sections from left sidebar and turn off “Show Sidebar” option showing on top of the middle section. Before explaining each section, here is the summary of WP Rocket settings.
|WP Rocket Settings||Features|
|Dashboard||Shows license and other quick links.|
|Cache||Mobile and user cache.|
|File Optimization||Minify and combine CSS and JS, remove unused CSS or generate critical CSS and defer/delay JS.|
|Media||Lazy loading of images and videos.|
|Preload||Preload fonts, cache, links and prefetch DNS.|
|Advanced Rules||Add cache exclusions.|
|Database||Delete revisions, autosaves, spam comment and schedule database cleanup.|
|CDN||Enable RocketCDN (additional premium add-on)|
|Heartbeat||Control Heartbeat API settings|
|Add-Ons||Free add-ons for Varnish, WebP detection, Cloudflare and Sucuri.|
|Image Optimization||Needs Imagify plugin.|
|Tools||Import/export settings, rollback and Google Font optimization|
|Tutorials||Quick links to video tutorials|
|Meta Box||Enable or disable features on page-level|
Remember, you do not need to activate all the options and make sure to test your site after setting up the plugin.
1. Dashboard – Get Help, Account Info
The dashboard section contains the license expiry information and quick links for doing different actions. You will also find renewal discount deal on top this section when the license expiry date is approaching.
The right sidebar under “Dashboard” tab has very useful links for clearing cache, start preloading and remove unused CSS. If you have disabled the right sidebar then you can access all these options from the top menu bar.
From the settings point of view, you can disable “Rocket Analytics” option under “My Status” section. This will help to opt out from sending anonymous data from your site to WP Rocket’s developer. There are FAQ, getting started and tutorial links available for you to quickly get answer to your questions. If you do not find any answer, click on the “Help” button to search and find more articles.
2. Cache – Basic Cache Options
Your actual settings start from here. The changes you make will be applied to your site after you hit the “Save Changes” button. Remember, WP Rocket will automatically enable page-level caching, enable compression and serve static HTML pages and there are no options to disable site wide page-level caching. You can exclude based on rules as explained in section 6 and exclude pages as explained in section 14.
- Mobile Cache – check the box against “Enable caching for mobile devices” option to cache mobile pages of your site. Leave the option “Separate cache files for mobile devices” without enabling. As clearly mentioned there, you do not need separate caching for mobile devices when using responsive themes. However, you have to enable this option when using a dedicated mobile theme using plugins like Jetpack. In addition, popular themes like Newspaper offers separate mobile theme. So, you have to enable separate mobile caching option in WP Rocket if you have enabled this in your theme settings.
Note: Mobile in WP Rocket indicates smartphones. If you want the plugin to treat tablets as mobiles and serve mobile cached pages, you have to install a helper plugin from GitHub. Otherwise, WP Rocket will not cache pages for tablets and visitors from tablets will see uncached pages.
- User Cache – user cache allows you to serve cached pages for logged in users. This is useful when you have subscription based websites and many users login and view your content. Otherwise, do not enable this option.
Note: Separate mobile cache and user cache are the first two settings you have to disable whenever you have a conflict with other caching plugins.
- Cache Lifespan – WP Rocket will automatically delete all cached files after the time limit you mention in the cache lifespan. There is a good technical reason behind this automatic cache deletion setup. WordPress uses nonce which is an automatically generated key within HTML code to validate certain actions. This nonce key is valid for 12 hours and will be regenerated again before 24 hours. In order to avoid viewing the page with expired nonce, you have to clear the cache. WP Rocket by default sets 10 hours as cache lifespan period. However, this will be too short for many sites as the plugin will delete all the cache and start preloading the pages every 10 hours. Therefore, we recommend to increase the time to 24 hours or even days if you are not frequently publishing/modifying content. If you see any problems, change this setting to less than 10 hours so that there will be no problems with nonces.
3. File Optimization – Optimize CSS & JS
- Minify CSS Files – enabling this option will help you to remove unnecessary space and comments from CSS and reduce the page size.
- Combine CSS Files – this is only enabled when enable minify CSS option and is disabled when you use remove unused CSS option. Nowadays, all hosting servers support HTTP/2 and works well with parallel HTTP requests. Hence, you can disable this option and use remove unused CSS.
- Optimize CSS delivery – you have two options here – load CSS asynchronously to generate critical CSS path for each post type on your site or remove unused CSS. You can enable only one option and this will help you to overcome render blocking CSS issues in Google PageSpeed and other speed measuring tools. For best results in Google PageSpeed, you can use the remove unused CSS on your site. Though this may break some elements, it can skyrocket your speed by loading only used CSS on the page.
Earlier WP Rocket was using large database tables to store the used CSS which is now changed to file based caching. Make sure to keep track of your cache folder to avoid file count or directory limit set by your hosting provider.
This section has similar settings like “CSS Files” section.
4. Media – Lazy Loading
Under this Media tab, you can optimize settings for images and other media files like YouTube videos.
- LazyLoad – enable lazy load for images, iframe and videos and replace YouTube iframe with preview image options. Lazy load will help you to stop loading of images outside the browser’s visible screen and load them when user scrolls nearer to the images. Make sure to test whether it works properly on your site. If you find any problems with lazy loading with WP Rocket, try other plugins like Jetpack or WP Smush.
- Image Dimensions – enable “Add missing image dimensions” option to automatically add height and width attributes for images. This will help to reduce cumulative layout shift issues and improve speed score in Google PageSpeed Insights.
Earlier, WP Rocket was offering options to disable emoji script and embed under this section. However, these options were removed from the plugin and no more available.
5. Preload – Generate Cache Files, Preload Fonts
Preloading is the function of crawling and caching the pages after clearing the cache. The starting point for preloading content is your XML Sitemap and the plugin will crawl all the links inside each URL.
- Activate Preloading – enable “Activate Preloading” option and WP Rocket will automatically detect the XML Sitemap generated with popular SEO plugins like Yoast SEO. You can exclude URLs in the text box if required.
- Preload Links – enabling “Links Preloading” will allow WP Rocket to fetch the linked content when user hovers over a link for 100 milliseconds or more.
- Prefetching DNS Requests – prefetching allows the plugin to fetch the third-party domains to reduce the connection time. Enter the URLs of Google Fonts or YouTube video URLs in the text box for prefetching.
- Preloading Fonts – preload key requests is one of the issues you will see in Google PageSpeed when using own fonts from CSS. You can copy and paste the relative font URLs on your site on the text box to remove the issue and improve the speed.
Note: Make sure to provide the correct URL format in the text boxes. For example, WP Rocket does not need the HTTP part for prefetching while you have to enter relative URL (ignoring the domain) for preloading fonts from your site.
6. Advanced Rules – Fine-tune Cache Rules
Advanced rules help you to maintain pages, cookies and user agents so that the plugin will never cache them. WP Rocket will never cache WooCommerce cart, checkout and my account pages automatically. Therefore, in most cases, you do not need to enter anything on this page and leave the settings as it is.
- Never Cache URL(s) – type the URLs of the pages you never want the plugin to cache. Good example, is if you have changed the WordPress login URL using security plugins, enter the new login URL in the text box.
- Never Cache Cookies – some users need cookies to dynamically change or validate content. For example, if you have cookie based login system enter the cookie ID for ignoring from caching.
- Never Cache User Agents(s) – WP Rocket will automatically fill all user agents of tablets. As mentioned above, the plugin will not cache pages for tablets using this setting. If you have enabled tablet as mobile using separate helper plugin then you have to remove all the tablet user agents from this list. In addition, you can maintain any other user agent that you want to serve uncached pages.
- Always Purge URL(s) – provide URLs in the text box for purging the cache whenever you publish or update content. Remember, WP Rocket will does this automatically for homepage.
- Cache Query String(s) – force WP Rocket to cache URLs with query strings.
7. Database – Optimize, Reduce Bloat
WP Rocket allows you to cleanup revisions, auto drafts, trashed posts, spam comments, trashed comments, expired transients and all transients. You do have an option to optimize database tables and schedule database cleanup with periodic intervals. We recommend not to setup the schedule and manually cleanup after taking database backup. Since, WP Rocket does not offer an option to backup your database, you have to use other plugins or download the database from you hosting account manually. Also, the cleanup action is irreversible, hence you should not setup automatic schedules without having a backup to restore.
8. CDN – Integrate Your CDN
If you have purchased RocketCDN subscription (which uses StackPath), then enable content delivery network option here. You can add separate CNAMEs for images, scripts and CSS or use single CNAME for all files. The plugin also allows you to exclude files from serving through CDN.
Note that no CNAMEs are required if you use CDNs like Cloudflare or Sucuri. WP Rocket also offers additional add-ons for these two networks. If you are on SiteGround, check our article on whether WP Rocket will work with SG Optimizer plugin in SiteGround
9. Heartbeat – Control WordPress Heartbeat API
Heartbeat API in WordPress allows you to get real-time updates like sales activities on your dashboard. If you do not need this, disable heartbeat API under this section.
Select “Control Heartbeat” option and then “Disable” for backend, post editor and frontend.
10. Add-ons – Add More Features
WP Rocket offers the following add-ons.
- Varnish – if you are using Varnish caching on server, then enable this option. If you are not sure whether your server uses Varnish, confirm with your hosting provider before enabling this option.
- WebP Compatibility – if you have a separate plugin to generate WebP images then enable caching of them in WP Rocket using this option.
- Cloudflare – enable this add-on if you are using Cloudflare CDN. You need to connect with your Cloudflare account by providing global API key. This helps to sync settings like minify and purge cache.
- Sucuri – enable if you are using Sucuri caching on your site. This add-on also needs API key and helps to clear Sucuri cache automatically syncing WP Rocket’s cache.
11. Image Optimization – Compress Your Images
WP Rocket offers another plugin called Imagify for optimizing your images. However, this is a limited features plugin that you need to upgrade for getting complete features. Imagify allows you to compress 25MB size for free account per month and needs premium upgrade for getting additional quota. If you have smaller site, install Imagify plugin and follow the setup under that plugin’s settings page.
As a premium customer of WP Rocket, I feel this is an unnecessary upselling and should not be part of the settings page (like WP Rocket CDN). You can simply ignore this settings page and use other plugins like WP Smush or SG Optimizer for SiteGround user.
12. Tools – Import, Export, Rollback
Tools section has few useful options:
- Export settings – click on “Download Settings” button to download the complete plugin settings as a JSON file.
- Import settings – use the downloaded JSON file to import the settings with single click.
- Rollback – if anything goes wrong after updating the plugin to newer version, you can rollback to the previous version by clicking the “Reinstall Version x.x.x.x” button.
- Enable Google Font Optimization – this is a one-time setting for optimizing Google Fonts. When you have multiple Google Font families and weights, the optimization will help you to combine the requests and reduce the network cycle. The button will disappear once you click on it.
- Update Inclusion and Exclusion List – this will be updated once in a week automatically for compatibility with other plugins. However, you can also manually update the list by clicking this button.
Import and export are useful if you want to use the plugin on different site and upload the settings quickly. In addition, you can always keep a download of the settings of current working version. In case of any problem when changing the settings, you can simply import the settings instead of rollback the plugin.
Note that WP Rocket will work on your localhost site with the same license key. Hence, you can import/export settings from live site to localhost for testing your site.
Under this section, you can find few useful video tutorials. You can view these videos as a pop-up inside the admin dashboard without leaving the website. Alternatively, you can click on the “More info” link showing next to the settings to get help documentation.
14. Page-Level Settings
WP Rocket will add a meta box in the editor (both Gutenberg and Classic) which you can use to change the page-level settings. For example, you can disable lazy loading or remove unused CSS option for single post while that setting is enabled site wide. This is also useful to exclude the page from caching when the page layout is broken due to delaying JS or combining CSS files.
If you miss the meta box, make sure to enable “WP Rocket Options” from “Screen Options” in Classic editor and “Options > Preference > Panels” section in Gutenberg.
WP Rocket offers so many settings to optimize your WordPress site. You have to be careful in enabling the required settings to get the most out of the plugin. I hope the above explanation is useful for you to setup the plugin. You can also check out the complete review of WP Rocket plugin before making your purchase decision.