Clearing your WordPress cache doesn’t always remove cached content from Cloudflare. If Cloudflare still holds an older version of a page, visitors may continue to see outdated content even after you’ve cleared the WordPress cache.
By connecting RunCache to Cloudflare, you can clear both caches directly from your WordPress dashboard, helping ensure visitors see the latest version of your site.
Before you start
Before you start, make sure you have:
- Administrator access to WordPress.
- Access to the Cloudflare account that manages your domain.
- Permission to create an API token for the relevant Cloudflare zone.
Connect Cloudflare to RunCache
To purge Cloudflare cache from WordPress, first connect RunCache to your Cloudflare account:
- Log in to Cloudflare and open your profile menu.
- Go to Profile > API Tokens.

- Click Create Token and select the WordPress template.
- Cloudflare pre-populates most of the token settings. You can keep the default permissions, but restrict the token to the domain you want RunCache to manage. Scroll to Zone Resources.
- Under Zone Resources, select Include > Specific zone, then choose your domain.

- Click Continue to Summary and review the token settings.
- Click Create Token. Cloudflare displays the token only once, so keep this tab open until you have copied the token into RunCache.
- Open WordPress in another browser tab or window, then go to RunCache > Dashboard > CDN Edge Cache.
- Rewrite the APO setup steps

- Enable Cloudflare APO.
- Paste the Cloudflare API token you created into the API token field.
- Click Save. After RunCache verifies the connection, the CDN Edge Cache section should display “Enabled and Working”.

This example uses Cloudflare APO. If you use Cloudflare Page Cache instead, select that provider in the CDN Edge Cache section and follow its configuration fields.
Purge the Cloudflare Cache from WordPress
After you connect a Cloudflare CDN Edge Cache provider, RunCache can send purge requests to Cloudflare when you clear cached content in WordPress.
- To clear the full cache, click Purge All in the WordPress admin bar or Purge cache in RunCache. RunCache also sends a full-zone purge request to Cloudflare.

- To purge the current page, click Purge this page. RunCache sends the related URLs to Cloudflare for purging.

If Cloudflare rejects a purge request, RunCache records the error in its logs rather than displaying an error in the WordPress admin area.
If content remains cached after a purge, check the RunCache logs for token, permission, or Cloudflare API errors.
Verify That the Cloudflare Cache Was Cleared
Cloudflare can return a cf-cache-status response header that indicates how it handled the request.
You can check the header with:
curl -s -o /dev/null -D - https://example.com/ | grep -i cf-cache-statusFor example:
cf-cache-status: dynamicThe cf-cache-status value can help you understand whether Cloudflare served a cached response:
HITmeans Cloudflare served the response from its cache.MISSmeans Cloudflare did not have a cached copy and requested the content from the origin server.DYNAMICmeans Cloudflare did not cache that response.
See Cloudflare’s documentation for the full list of possible values.

If the cf-cache-status header is missing, check that the domain is proxied through Cloudflare.
After purging a cached page, check the next request again. You should normally see Cloudflare fetch a fresh response rather than immediately serving the previous cached copy.
If the page continues to return HIT unexpectedly, check the RunCache logs and confirm that the API token has permission to purge the selected zone.
Once Cloudflare has fetched the updated page, later requests may return HIT again as the edge cache is repopulated.