Can I Use WP Ghost with Cloudflare?
This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.
Yes. WP Ghost works with Cloudflare without issues. WP Ghost includes CDN URL Mapping that ensures your custom paths are correctly reflected in CDN-served files. After changing paths in WP Ghost, purge the Cloudflare cache so the new URLs are served from the CDN. No special Cloudflare configuration is required beyond a standard cache purge.
How WP Ghost Works With Cloudflare
Cloudflare sits between your server and your visitors as a reverse proxy and CDN. It caches static files (CSS, JS, images) and serves them from edge servers around the world. When WP Ghost changes your WordPress paths, the new URLs need to be reflected in the files Cloudflare serves. WP Ghost handles this automatically through its rewrite rules, which run on your server before Cloudflare caches the output.
The one thing you need to do manually is purge the Cloudflare cache after making path changes in WP Ghost. Cloudflare may still serve cached copies of your pages with the old paths until the cache is cleared. Go to your Cloudflare dashboard, navigate to Caching > Configuration, and click Purge Everything. After the purge, Cloudflare fetches fresh pages from your server with the new paths and caches those instead.
CDN URL Mapping
If you use a Cloudflare CDN URL that differs from your site URL (for example, if you serve static files from a cdn.yourdomain.com subdomain), WP Ghost’s CDN URL Mapping feature ensures that the custom paths are applied to CDN-served files as well. Go to WP Ghost > Mapping > CDN Mapping, enter your CDN URL, and save. WP Ghost will replace the old WordPress paths in CDN URLs with your custom paths throughout the page source. For the full CDN configuration guide, see the CDN URL Mapping tutorial.
Cloudflare Firewall and WP Ghost Firewall
Cloudflare includes its own WAF (Web Application Firewall) that filters traffic at the CDN level before it reaches your server. WP Ghost’s 7G/8G firewall operates at the server level after traffic arrives. The two work at different points in the request chain and complement each other. Cloudflare blocks known attack patterns at the edge, and WP Ghost blocks anything that gets through at the server level. You do not need to disable either firewall.
If Cloudflare’s security rules are blocking legitimate requests to your site after WP Ghost changes paths, check your Cloudflare Firewall Events log for blocked requests and create exceptions for your custom paths if needed.
Frequently Asked Questions
Do I need to purge Cloudflare cache every time I change a path?
Yes. After any path change in WP Ghost, purge the Cloudflare cache so visitors receive pages with the updated URLs. If you use a Cloudflare WordPress plugin, it may offer automatic cache purging. Otherwise, purge manually from the Cloudflare dashboard.
Will Cloudflare’s “Always Online” or caching features interfere with WP Ghost?
Not normally. Cloudflare’s caching serves the same pages your server generates, including WP Ghost’s custom paths. “Always Online” serves a cached copy when your server is down, which will show the paths from the last cache update. If you made path changes and the cache wasn’t purged before your server went offline, visitors might see old paths temporarily until the server recovers and the cache refreshes.
Does WP Ghost work with other CDN services too?
Yes. WP Ghost’s CDN URL Mapping works with any CDN service including Cloudflare, StackPath, KeyCDN, BunnyCDN, and CDN services built into hosting providers. The same principle applies: configure the CDN URL in WP Ghost’s mapping settings and purge the CDN cache after path changes. See the CDN Enabler compatibility guide for additional CDN-specific tips.
Does WP Ghost modify WordPress core files?
No. WP Ghost uses rewrite rules and WordPress filters. No core files are modified. Cloudflare proxies the output your server generates, and WP Ghost’s path changes are applied before Cloudflare sees the response.