Speed & performance · Info
WP Rocket Cloudflare Settings Explained: What Each Option Does

Short answer
WP Rocket's Cloudflare add-on connects WP Rocket to your Cloudflare account with an API token or key and your Zone ID. It lets you purge Cloudflare's cache, toggle development mode and apply suggested settings. Leave minify and script delay to WP Rocket and turn off Rocket Loader.
Key takeaways
- The Cloudflare add-on sits on WP Rocket's Add-ons tab.
- A scoped API token is safer than the Global API Key.
- Development mode bypasses Cloudflare's cache for three hours.
- Turn off Rocket Loader when WP Rocket delays JavaScript.
- APO users should manage purging with Cloudflare's own plugin.
What are the WP Rocket Cloudflare settings?
The WP Rocket Cloudflare settings connect WP Rocket to your Cloudflare account so it can purge Cloudflare's cache, switch on development mode and apply suggested speed settings from inside WordPress.
They live in the Cloudflare add-on on WP Rocket's Add-ons tab. You turn the add-on on, open its options, and enter the details that let WP Rocket talk to the Cloudflare API.
You do not need the add-on for Cloudflare to work. Cloudflare sits in front of your site at the DNS level either way, and WP Rocket's page cache works behind it.
What the add-on adds is coordination. When WP Rocket clears its cache, it can clear Cloudflare's too, so visitors do not get old copies of your pages.
WP Rocket has changed this add-on across versions, so the exact fields may differ from what you see. The WP Rocket guide to using Cloudflare is the reference for your current version.
| Setting | What it does | Suggested choice |
|---|---|---|
| Cloudflare credentials | Lets WP Rocket call the Cloudflare API | Use a scoped API token where offered |
| Zone ID | Tells WP Rocket which domain to manage | Copy from the domain's overview page |
| Development mode | Bypasses Cloudflare's cache for a few hours | Use only while making design changes |
| Optimal settings | Applies Cloudflare settings WP Rocket suggests | Review each before relying on it |
| Clear Cloudflare cache | Purges everything Cloudflare has cached | Use after major site changes |
| Auto purge with WP Rocket | Clears Cloudflare when WP Rocket clears | Keep on |
Do you need the WP Rocket Cloudflare add-on?
You need the add-on only if Cloudflare caches your HTML pages or you want one button to clear both caches, because otherwise Cloudflare mostly caches static files that update on their own.
By default, Cloudflare caches files like images, CSS and JavaScript, but not your HTML. WP Rocket handles HTML caching on your server, so updates appear as soon as WP Rocket clears its cache.
The add-on becomes useful when you add Cloudflare cache rules that store full pages. Then a post update must clear Cloudflare too, or visitors see the old version.
It also helps if you change CSS or JavaScript often. Clearing Cloudflare from the WordPress dashboard is quicker than logging into Cloudflare each time.
If you use Cloudflare APO, the picture changes again. APO caches HTML at Cloudflare's edge and has its own purge system, which the section on APO below covers.
How do you connect WP Rocket to Cloudflare?
Turn on the Cloudflare add-on in WP Rocket, open its settings, enter your Cloudflare credentials and Zone ID, and save, after which WP Rocket checks the connection.
The steps are:
- Go to Settings → WP Rocket → Add-ons.
- Switch on the Cloudflare add-on and click its settings button.
- Enter your Cloudflare credentials as the form asks.
- Paste the Zone ID for your domain.
- Save, and check for a success or error message.
The Zone ID is on the overview page for your domain in the Cloudflare dashboard. It is a long string unique to that domain.
For credentials, a scoped API token is safer than your Global API Key, because it can only do what you allow. Cloudflare explains how to create an API token with limited permissions.
If your WP Rocket version only asks for an email and Global API Key, treat that key like a password. Anyone with it can change your whole Cloudflare account.
What does Cloudflare development mode do in WP Rocket?
Development mode tells Cloudflare to stop serving cached files for a short time, so you see changes to CSS, JavaScript and images straight away while you work on the site.
Cloudflare's development mode documentation says it turns off automatically after three hours. Your site still uses Cloudflare's network, just without its cache.
Use it while editing your theme or testing design changes. Turn it off when you finish, because visitors get slower pages while it is on.
You can also toggle development mode in the Cloudflare dashboard. The WP Rocket switch is simply a shortcut.
If you are only fixing a single file, clearing the cache is often enough. Development mode is more useful for longer sessions of changes.
What do the optimal settings do?
The optimal settings option applies a set of Cloudflare settings that WP Rocket suggests for working alongside its own caching, so the two tools do not repeat the same work.
The idea is to avoid doubling up. For example, if WP Rocket already minifies files, Cloudflare does not need to do it again, and features that rewrite scripts can clash with WP Rocket's script delay.
Check what the option actually changes before relying on it. WP Rocket's Cloudflare recommended settings page lists the current advice.
Cloudflare has also retired some older features over time. Settings that once mattered, such as Cloudflare's own Auto Minify, may no longer appear in your dashboard.
You can always set these by hand in Cloudflare. That gives you more control and makes it easier to undo a single change.
Should you turn off Rocket Loader when using WP Rocket?
Yes, it is usually best to turn off Cloudflare Rocket Loader when WP Rocket's delay JavaScript option is on, because both change how scripts load and can break menus, sliders or forms.
Rocket Loader defers JavaScript at Cloudflare's edge. WP Rocket's delay feature does something similar on your server. Running both stacks two script tricks on top of each other.
Cloudflare's Rocket Loader documentation shows where to turn it off. It sits in the speed optimization settings for your domain.
If something on your site stops working after a speed change, check Rocket Loader first. Our guide on WP Rocket delay JavaScript exclusions covers how to fix scripts that break under WP Rocket.
How does clearing the cache work with both tools?
When the add-on is connected, clearing WP Rocket's cache can also purge Cloudflare's cache, so both layers serve fresh files after you update content or change design.
Without the add-on, the two caches are separate. You clear WP Rocket from WordPress and Cloudflare from its own dashboard.
A full Cloudflare purge removes every cached file on its network. Cloudflare's guide to purging cache explains the full and single-file options.
Avoid purging everything too often. After a full purge, Cloudflare must fetch every file from your server again, which briefly adds load.
Our guide on clearing WP Rocket cache covers each method inside WordPress.
For the Cloudflare side, see our guide on clearing Cloudflare cache in WordPress.
How should you set up Cloudflare APO with WP Rocket?
If you use Cloudflare APO, install Cloudflare's own WordPress plugin to manage APO purging, and keep WP Rocket for file optimization, because APO caches your HTML at Cloudflare's edge.
APO stores full pages on Cloudflare's network, so it needs a purge system that clears pages when you publish. The Cloudflare WordPress plugin handles that.
WP Rocket documents how to run both in its guide on using Cloudflare APO with WP Rocket. Follow it closely, since running two purge systems on one zone can clash.
APO is a paid add-on on the free Cloudflare plan. Our guide on whether Cloudflare APO is worth it weighs the cost against the speed gain.
Which Cloudflare settings work well with WP Rocket?
Settings that work well with WP Rocket include full strict SSL, Brotli compression, sensible cache rules for static files, and Rocket Loader off, while minification and script delay are left to WP Rocket.
SSL. Use Full or Full (strict) mode to avoid redirect loops. Our guide on Cloudflare SSL settings for WordPress explains each mode.
Browser cache. WP Rocket sets browser caching headers on your server. You can let Cloudflare respect them, so both agree on how long files stay cached. MDN's page on the Cache-Control header explains the values.
Cache rules. If you cache HTML at Cloudflare, bypass the cache for logged-in users, the admin area, cart and checkout. Our guide on Cloudflare cache rules for WordPress shows example rules.
Image tools. If both WP Rocket and Cloudflare offer image changes, pick one tool for each job. Doubling up rarely helps and makes problems harder to trace.
What should you do if the add-on shows an error?
If the add-on shows an error, check that your token or key is correct, the token has permission for the right zone, and the Zone ID matches the domain your site uses.
Most errors come from copy and paste mistakes. An extra space or a missing character in the token or Zone ID stops the connection.
Token permissions matter too. A token that cannot read zone settings or purge cache will fail even when it is typed correctly.
If you moved the site to a new domain, update the Zone ID. The old ID points to a different zone, so purges and settings changes will not affect the new site.
Finally, remember that Cloudflare can be useful without the add-on. If it keeps failing, turn it off, manage Cloudflare in its own dashboard, and keep WP Rocket for caching. Our overview of WP Rocket settings covers the rest of the plugin.
Frequently asked questions
Does WP Rocket work with Cloudflare without the add-on?
Yes. Cloudflare works at the DNS level, so WP Rocket caches pages on your server while Cloudflare serves static files from its network. The add-on only adds convenience, such as purging Cloudflare's cache when WP Rocket clears its own.
Where do I find my Cloudflare Zone ID?
Log in to the Cloudflare dashboard, select your domain, and look on the overview page. The Zone ID is shown in the API section, usually in the sidebar. Copy it exactly and paste it into the WP Rocket Cloudflare add-on settings.
Should I use the Global API Key or an API token?
Use a scoped API token if your WP Rocket version supports it. A token can be limited to one zone and only the permissions WP Rocket needs. The Global API Key controls your whole Cloudflare account, so a leak would be far more serious.
Should Cloudflare minify files if WP Rocket already does?
No. Minifying twice adds no benefit and can cause errors that are hard to trace. Let WP Rocket handle minification, or use one tool only. Cloudflare has also retired its older Auto Minify feature, so it may not appear in your dashboard.
Why do visitors still see old pages after I clear WP Rocket?
Cloudflare may still hold a cached copy, especially if you cache HTML with cache rules. Connect the Cloudflare add-on so purges happen together, or purge Cloudflare's cache from its dashboard after major updates.
Sources
- Using Cloudflare with WP Rocket WP Rocket Docs
- Cloudflare - Recommended settings WP Rocket Docs
- Using Cloudflare APO with WP Rocket WP Rocket Docs
- Development Mode Cloudflare Docs
- Rocket Loader Cloudflare Docs
- Create API token Cloudflare Docs
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


