Cloudflare Setup and Token Permissions

Connect Warp Performance to Cloudflare step by step, create a token with exactly the right permissions, and fix the case where the connection works but Warp cannot write its cache rules.

Saurabh GuttedarUpdated Nov 22, 202611 min read

This guide connects Warp Performance to Cloudflare. It covers where to click in Cloudflare and in Warp, which token permissions you need, and what to do when Warp connects but cannot create its edge cache rules. That last problem is easy to miss, so it has its own section.

What Warp does with Cloudflare

Warp uses your Cloudflare credential for two separate jobs. Each job needs different permissions, and one can work while the other fails.

JobWhat it doesPermissions it needs
PurgingClears Cloudflare's copy of a page whenever Warp clears its own cache.Zone Read, Cache Purge
Edge caching (Boost Speed)Creates and maintains Cloudflare cache rules so Cloudflare can serve your HTML pages from its edge. Also creates a rule that ignores tracking parameters in the query string.Cache Rules Edit, Transform Rules Edit

If you only want purging, two permissions are enough. If you want Cloudflare to cache your pages, you need all four.

The four permissions

Warp needs these four permissions, scoped to your site's zone only. The names below are exactly as Cloudflare shows them when you create a token.

Permission in CloudflareWhy Warp needs it
Zone → Zone → ReadReads the zone to confirm it is active and that it belongs to this site.
Zone → Cache Purge → PurgePurges pages and the whole cache.
Zone → Cache Rules → EditCreates the three cache rules: bypass for logged-in visitors, cache pages, cache static files.
Zone → Transform Rules → EditCreates the rule that strips tracking parameters from the query string.

Optional: Zone → DNS → Read. With it, the connection test can warn you if your domain is set to DNS only (grey cloud). Without it, you simply get no warning.

Important: choose Edit, not Read, for Cache Rules and Transform Rules. Read-only is the mistake behind the problem described in "Connected, but Warp cannot write its rules" below.

Before you start

  1. Your domain is added to Cloudflare and shows as Active.
  2. The DNS record for your site (the A, AAAA or CNAME record for your domain or www) has the orange cloud turned on (Proxied). With the grey cloud (DNS only), visitors bypass Cloudflare and no cache rule ever runs.
  3. You know your Zone ID. In the Cloudflare dashboard, click your domain, open Overview, and look in the right-hand column under API. Copy the Zone ID. Do not copy the Account ID next to it.
  4. You are on this site's own zone. A Zone ID from a different domain is refused (see Troubleshooting).

Option A: let Warp create the token for you

This is the fastest route. You give Warp your Global API Key once, Warp creates a limited token, and then stops using the Global API Key.

  1. In Cloudflare, open My Profile → API Tokens (dash.cloudflare.com/profile/api-tokens) and scroll to API Keys. Next to Global API Key, click View and copy it.
  2. In WordPress, open Warp Performance → CDN, find the Cloudflare Integration card and turn on Enable Cloudflare Integration.
  3. Enter your Cloudflare account email in Email and paste the Global API Key into Global API Key / API Token. Leave Zone ID empty, or paste it.
  4. A box titled Swap your Global API Key for a scoped token appears. Click Generate scoped token.
  5. Warp creates a token named Warp Performance (your-domain) limited to this zone and the four permissions, tests it, and saves it in place of your Global API Key. The Zone ID is filled in for you and the email field is cleared. If the test fails, Warp revokes the token and changes nothing.

If Cloudflare does not offer one of the permissions through this route, Warp tells you and asks you to create the token by hand (Option B).

Option B: create the token yourself

  1. In Warp, open CDN → Cloudflare Integration, enable the integration, and click Open Cloudflare token form. This opens Cloudflare's token page with the name, Zone Read and Cache Purge already filled in. (You can also go to dash.cloudflare.com/profile/api-tokens and click Create Token → Create Custom Token.)
  2. Cloudflare cannot prefill the rest. Under Permissions, click Add more and add these two rows exactly:
    • Zone → Cache Rules → Edit
    • Zone → Transform Rules → Edit
    Check that all four rows are present, and that the two rules rows say Edit.
  3. Under Zone Resources, set Include → Specific zone and choose your site's domain. Do not use "All zones".
  4. Click Continue to summary, then Create Token. Copy the token now. Cloudflare shows it only once.
  5. Back in Warp, paste the token into Global API Key / API Token. Leave Email empty (it is only for Global API Keys). Paste the Zone ID into Zone ID.

Finish the connection in Warp

  1. On CDN → Cloudflare Integration, click Test. Read the message against the table in the next section.
  2. Turn on Boost Speed if you want Cloudflare to cache your HTML pages. This is what makes Warp create the edge rules.
  3. Optional: turn on Ignore Query String to serve one cached copy regardless of tracking parameters. It is disabled while WooCommerce is active, because shop filters rely on query strings.
  4. Click Save. Warp creates the rules in Cloudflare when you save with Boost Speed on.
  5. Click Test again. You want: Successfully connected to Cloudflare Zone: your-domain. All cache rules are deployed.

What the Test message means

MessageMeaningWhat to do
All cache rules are deployed.Everything works.Nothing.
Cache rules are not deployed yet (missing: …). Save your settings with Page Caching enabled to create them.Connected, but one or more Warp rules do not exist in Cloudflare yet. This is normal before your first save. It is also what you see when the token can read but not write (next section).Turn on Boost Speed, save, test again. If it stays that way, read the next section.
Connected to zone '…', but this credential is missing: Zone > Cache Rules > EditThe token cannot even read that rule area. Purging can still work.Add the permission named in the message (see the fix below).
Failed to connect. Verify your API Token, Email (if using Global Key), and Zone ID.Wrong token, wrong Zone ID, or an expired or revoked token. A Global API Key without the email also lands here.Re-copy the token and the Zone ID. If you use a Global API Key, fill in Email.
This Zone ID belongs to '…', not your-domain.The Zone ID is from a different domain.Use the Zone ID of this site's own domain. A subdomain of the zone is fine.
Zone '…' is not active on Cloudflare.The domain is pending or moved in Cloudflare.Finish activating the domain in Cloudflare first.
Warning: your-domain is set to DNS only…The orange cloud is off, so Cloudflare never sees visitor traffic.Turn on the proxy (orange cloud) for the record in Cloudflare → DNS.

Connected, but Warp cannot write its rules

This is the case people miss. Cloudflare lets you give a token Read or Edit on Cache Rules and Transform Rules. Warp's connection test only reads. It never tries to write. So a token with read-only access on those two permissions passes the test, the dashboard looks healthy, and purging works, yet Warp is unable to create a single edge rule.

How it shows up

  • Test says Connected, but also Cache rules are not deployed yet (missing: …), and it still says that after you save with Boost Speed on.
  • In Cloudflare, under your domain's Caching → Cache Rules, there are no rules whose names start with Warp Performance.
  • Your pages show cf-cache-status: DYNAMIC instead of HIT in the response headers. Cloudflare passes every request to your server.
  • Saving the Warp settings does not fail. Warp only records the refusal in its debug log, as a line like CLOUDFLARE API ERROR [POST /rulesets…]: HTTP 403. To see it, turn on Debug mode in Warp and read the Warp debug log.
  • Partial case: the token has Cache Rules Edit but not Transform Rules Edit. Page caching rules are created, but the query-string rule Warp Performance cache ignore query params is listed as missing.

How to fix it

  1. In Cloudflare, open My Profile → API Tokens (dash.cloudflare.com/profile/api-tokens).
  2. Find the token Warp uses (Warp Performance (your-domain) if Warp created it). Click Edit on its row.
  3. Under Permissions, make sure these rows exist, and change any that say Read to Edit:
    • Zone → Cache Rules → Edit
    • Zone → Transform Rules → Edit
    Keep Zone Read and Cache Purge → Purge as they are.
  4. Check Zone Resources still says Include → Specific zone → your domain. Click Continue to summary, then Save. The token value does not change. You do not need to copy it again.
  5. Back in Warp, go to CDN → Cloudflare Integration and click Test. The missing-permission warning should be gone.
  6. Make Warp redeploy. Because the token value is the same, saving the page on its own does not make Warp retry. Turn Boost Speed off, click Save, turn it on again, and click Save again. Turning it off removes Warp's rules from Cloudflare, and turning it back on creates them fresh. Do this at a quiet time, because Cloudflare stops caching your HTML for the few seconds in between.
  7. Click Test once more. You want: All cache rules are deployed.

A faster alternative: create a new token with the correct permissions (Option A or B) and paste it into Warp. A changed token makes Warp deploy the rules straight away, with no need to toggle Boost Speed.

Check it worked

  1. In Cloudflare, open your domain and go to Caching → Cache Rules. You should see three rules whose names start with Warp Performance and end with your domain in brackets: bypass cache for logged-in users, cache page, and cache static files.
  2. Go to Rules → Transform Rules. You should see Warp Performance cache ignore query params.
  3. In a private browser window, open a page of your site twice, then check the response headers (browser developer tools, Network tab). The second load should show cf-cache-status: HIT. Logged-in visitors will always see a bypass, by design.

When Warp creates, changes or removes rules

Knowing the triggers explains why a fix sometimes seems to do nothing.

EventWhat Warp does
You save with Boost Speed on and the credentials, zone, mobile caching, bypass cookies or bypass URLs changedCreates or updates the rules.
You save with nothing relevant changedNothing. Warp does not retry on every save.
You turn Boost Speed or the integration offDeletes Warp's rules from Cloudflare.
You deactivate the pluginDeletes Warp's rules.
You update or reactivate the pluginChecks and recreates the rules.
Your site address changesWarp notices and rebuilds the rules for the new domain.

Rules are tied to the site that made them. Their names include your domain, so a staging site that shares a zone will not adopt or delete the live site's rules.

Troubleshooting

ProblemLikely causeFix
Test passes, purging works, pages never cached at the edgeToken has Read, not Edit, on Cache Rules or Transform Rules. Or Boost Speed is off.Follow "Connected, but Warp cannot write its rules".
Edge caching works but tracking parameters still split the cacheMissing Transform Rules Edit, or Ignore Query String is off.Add the permission, redeploy, and turn Ignore Query String on. It is unavailable while WooCommerce is active.
Pages not purged on Cloudflare after editsToken lacks Cache Purge → Purge, or the Zone ID is wrong.Add the permission, check the Zone ID, then run Purge from the Warp admin bar.
"Zone ID belongs to a different domain"Zone ID copied from another site, or the site runs on a hostname outside the zone.Use this domain's Zone ID. For Cloudflare for SaaS setups, developers can allow it with the WARP_PERFORMANCE_cloudflare_zone_serves_site filter.
Global API Key keeps failingEmail missing or mistyped.Fill in Email, or swap to a scoped token with Option A.
No rules in Cloudflare, no error anywhereCloudflare refused the write and Warp logged it quietly.Turn on Debug mode and read the debug log for CLOUDFLARE API ERROR. HTTP 403 means a missing permission. HTTP 401 means a bad or revoked token.
Rules disappear after switching things offBy design: turning Boost Speed or the integration off removes them.Turn Boost Speed back on and save.
You want to rotate or retire the tokenSecurity hygiene, or a leaked token.Create a new token (Option A or B), paste it in Warp and save. Then delete the old token in Cloudflare.

Security notes

  • Use a scoped token, not the Global API Key. A Global API Key can change everything in your Cloudflare account. The scoped token can only touch this one zone, and only these four permissions.
  • Warp never returns the token through its AI assistant (MCP) connection, and the MCP tools cannot change Cloudflare settings.
  • If you also use the Cloudflare APO plugin, Warp keeps APO's cache in sync on purge. See the Plugin Compatibility page.

Was this page helpful?