Customize Preload sitemaps and priority
By default, the Preload feature scans your sitemaps to detect all the URLs to preload, and as each one is preloaded, it’s added to the wpr_rocket_cache table in your database. The feature also listens to user traffic and adds visited URLs to the table if they aren’t already there, keeping the list of cached URLs up to date.
If needed, you can customize which sitemaps WP Rocket uses, set their priority, and apply other tweaks to adjust how the feature works.
In this article, you will find a helper plugin which you can use to:
- Preload only specified sitemaps or add additional sitemap to preload.
- Preload only pages contained in your sitemaps.
- Customize preload order.
- Add custom sitemaps.
Heads up! This guide includes advanced configuration of the Preload feature. In most cases, the default behavior of this feature is the adequate, and customization is not required.
Helper plugin
The following plugin will help you modify the Preload behavior by customizing the sitemaps you need to preload, and the order in which they are preloaded.
📥 Download (.zip): WP Rocket | Preload Sitemap Control
Developers: You can find the code for this plugin on GitHub.
Heads up! The helper plugin doesn't work on its own. Manual code edit is required before use!
Use the README.md file for the specific details about how to apply each customization.
To customize the helper plugin, please:
- Download the helper plugin ZIP file and extract it.
- Open the
wp-rocket-preload-sitemap-control.phpfile using a text/code editor. - Apply the required customization(s) as per the README.md file.
- Save changes.
- Compress the helper files into a ZIP file.
- On your site - go to Plugins → Add New → Upload plugin, and select the ZIP file.
- Activate the plugin.
Upon activation, this helper plugin will automatically clear all the URLs in the cache table.
And, that's it!
To verify that the solution works, you can check the URLs in the database, in the wp_wpr_rocket_cache cache table.
If you need further help, please contact support.