WP Ghost is fully compatible with WP Rocket. WP Rocket is one of the most popular premium WordPress caching plugins, handling page caching, file optimization (minify and combine CSS/JS), lazy loading, database optimization, and CDN integration. To use both plugins together while keeping WP Ghost’s path security intact, you need to enable WP Rocket’s file optimization, then turn on WP Ghost’s Change Paths in Cache Files option. WP Ghost automatically detects WP Rocket and creates the necessary URL mapping for the cache paths. This guide walks through the complete configuration.
WP Rocket generates combined and minified CSS/JS files stored in its cache directory (/cache/min/). These files contain references to your original WordPress paths. Without WP Ghost coordination, the optimized files expose your WordPress structure in their URLs (/cache/min/1/wp-content/ and /cache/min/1/wp-includes/). WP Ghost handles this automatically by detecting WP Rocket and creating URL mapping entries, but you still need to enable Change Paths in Cache Files so the content inside cached files also gets updated.
Configure WP Rocket to minify and combine your CSS and JS files:
Tip: Combining files reduces HTTP requests but may cause issues on some sites if JS/CSS files have dependencies. Test your site after enabling combining – if specific scripts break, exclude them from combining in WP Rocket’s File Optimization settings rather than disabling the feature entirely.
Tell WP Ghost to rewrite the paths inside WP Rocket’s cached files. Without this step, your combined CSS/JS files still reference the original WordPress paths.
WP Ghost runs a background WP Cron job that processes cached files and updates the paths automatically. For complete configuration details, see Change Paths in Cached Files.
Important: After enabling this option, clear the WP Rocket cache so the next page load creates fresh optimized files with the updated paths. Go to WP Rocket in the admin bar and click Clear Cache. If WordPress Cron is disabled on your site, you can manually trigger the path update from WP Ghost’s settings.
WP Ghost automatically detects WP Rocket and creates URL mapping entries to handle the cache directory paths. By default, WP Rocket’s combined files live at URLs like /cache/min/1/wp-content/ and /cache/min/1/wp-includes/, where 1 is the site ID. WP Ghost maps these to your custom paths automatically.
You can verify and customize these mappings at WP Ghost > Mapping > URL Mapping.
Automatic detection: You don’t need to create these URL mappings manually. WP Ghost detects WP Rocket on activation and creates them automatically. If you change your WP Ghost custom paths later, the URL mappings update when you save settings.
wp-content/plugins and wp-content/themes. They should NOT appear – you should see your custom WP Ghost paths instead./cache/min/1/wp-content/ – they should use your custom paths.The WP Rocket cache hasn’t been cleared since enabling Change Paths in Cache Files in WP Ghost. Click the WP Rocket icon in the admin bar and select Clear Cache. Visit a few pages while logged out to regenerate the cache with the updated paths.
Check that the URL mapping is in place at WP Ghost > Mapping > URL Mapping. If no WP Rocket mappings appear, re-save your WP Ghost settings – this triggers the automatic detection. If the mappings exist but paths are still visible, clear both the WP Rocket cache and your browser cache.
This is a common WP Rocket issue, not a WP Ghost conflict. Some JS/CSS files break when combined. In WP Rocket File Optimization, use the “Excluded Inline JavaScript” and “Excluded JavaScript Files” fields to exclude problematic scripts. Test which files cause the issue by excluding them one at a time.
If you use WP Rocket’s CDN integration, purge the CDN cache after changing WP Ghost paths. The CDN serves cached versions from edge servers that won’t update until purged. Go to WP Rocket > CDN to manage your CDN settings.
Yes. WP Ghost automatically detects WP Rocket and creates URL mapping entries for the cache directory paths. You don’t need to configure the URL mapping manually. The mappings update automatically when you save WP Ghost settings.
Yes, whenever you change paths in WP Ghost. Cached files contain the old paths until regenerated. Clear the WP Rocket cache after any WP Ghost path change to ensure visitors see the updated paths immediately.
If you use WP Rocket with a CDN (Cloudflare, BunnyCDN, KeyCDN, or WP Rocket’s own CDN), you also need to purge the CDN cache after enabling WP Ghost path changes. The CDN serves cached versions from edge servers that won’t reflect the new paths until purged.
Yes. WP Ghost is fully compatible with WooCommerce and WP Rocket works with WooCommerce too. WP Rocket automatically excludes cart, checkout, and account pages from caching by default.
No. WP Ghost writes rewrite rules to .htaccess (Apache) or hidemywp.conf (Nginx) and uses WordPress hooks for application-level changes. No core files are modified. Deactivating WP Ghost restores all defaults instantly.
WP Ghost with cache and performance plugins:
Replace the default wp_ database prefix with a random one to protect against SQL injection…
Change the WordPress uploads directory path with WP Ghost (rewrite rules, no files moved) or…
https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…
The security of your WordPress site depends on multiple factors, such as the strength of…
Step-by-step guides to connect WP Ghost 2FA with Google Authenticator, Authy, Microsoft Authenticator, or LastPass.…
Enable the 7G Firewall in WP Ghost for server-level protection against SQL injection and script…