Technical Configurations

Technical guides, info, and code examples.

Add code snippets

In some cases, you might need to use snippets to fix specific issues or change WP Rocket's default behavior. There are two ways to achieve this:Add the snippet using a plugin For many WordPress users, using a plugin to add the…

Adding custom rules to the htaccess file

When you change or save WP Rocket's settings, the htaccess file is regenerated. WP Rocket always places its rules at the very top of the file, so if you had any custom rules there, they will get pushed down, below…

CRON and WP Rocket

This article covers all the relevant information about cron on WordPress and its relation with some WP Rocket's features, as well as instructions to set up cron job in the server, and a common issues section. What is cron? Cron…

Disable use of the htaccess file by WP Rocket

In some server environments you may not have permissions to modify the htaccess file. To prevent unnecessary warnings, or for any other compatibility reason, you can prevent WP Rocket from trying to update the htaccess at all by installing the…

Fixing non-www redirection

Not having the correct redirects in place for the various versions of your domain can cause problems. There are a few ways to set up these redirects. ⚠️  After implementing any of the following solutions remove old configuration and cache…

get_rocket_cdn_url()

WP Rocket rewrites all the URLs of your images to the CDN URL. However, in rare cases image URLs may not be rewritten, because the theme, or a plugin does not use native WordPress functions to display images. It is…

How to check if cron is running correctly

WP Rocket's Preload, Remove Unused CSS, automatic cache clearing, and other features, heavily depend on cron. So, whether you're using WP Cron or a server side cron job, you should make sure the frequency of occurrence is reliable and high…