Cloudflare Under Attack Mode on WordPress: What It Blocks (Tested)
Cloudflare Under Attack mode puts a check page in front of your whole site. Every visitor’s browser has to run a short JavaScript challenge before Cloudflare lets the request through. It is meant for one job: riding out a layer 7 DDoS attack, the kind that floods your pages with requests until the server falls over.
The part most guides skip is what it does to everything that is not a browser. I switched it on for a WordPress test site and checked with curl: the homepage, the RSS feed, the REST API and wp-cron.php all got 403 Forbidden, and so did the server’s own request to its cron. Below is how to turn it on, what broke, and how I limited it to the login page instead.
Tested by Dolon Bepari, 20 and 21 November 2026
- Server: a throwaway Ubuntu 22.04 VPS (1 vCPU, about 2 GB RAM), aaPanel 7, Nginx 1.30.7, PHP 8.4, WordPress
- Cloudflare: Free plan, orange cloud (proxied), test domain filecafe.site
- How I measured: curl and a browser from my PC in Dhaka, Bangladesh, through Cloudflare, plus curl on the server itself
- There are no affiliate links in this guide. How I test: how we review
Table of Contents
What Cloudflare Under Attack mode does
With Under Attack mode on, Cloudflare answers the first request from a visitor with a check page (an interstitial) instead of your site. In my test the browser tab said “Just a moment…” and the page said Performing security verification, with a small “Verifying…” box. A normal browser runs the check on its own; the visitor does not have to click anything. Then Cloudflare sends them on to the real page.

Cloudflare’s own page on the feature (last updated 20 April 2026, checked 21 November 2026) says the check finishes within five seconds, and that a visitor who passes does not see it again until their Challenge Passage time runs out. I did not time it myself, so I am not giving a number. It also calls the mode a last resort that temporarily pauses access to the site, notes that it affects analytics, and says the visitor’s browser must support JavaScript.
That JavaScript rule is the key to everything else in this guide. Most feed readers, uptime monitors, apps and server scripts cannot run the challenge, so they never get past it.
How to turn on Under Attack mode in Cloudflare
It is one switch, and it is on the Free plan. No command is needed:
- Log in to the Cloudflare dashboard and open your domain (the zone overview page).
- In the Quick Actions sidebar, switch Under Attack Mode on. The panel describes it as showing visitors a non-interactive challenge when they visit your site.
- To turn it off, switch the same toggle off. It is off by default.
- The same setting is also under Security, Settings (the rule editor points there).

The change applies to the whole zone (your domain in Cloudflare), so every page and every hostname that is proxied (orange cloud) gets the check. Cloudflare also lets you turn it on for only part of a site with a Configuration Rule, and for chosen countries, networks (ASNs) or IP ranges with IP Access Rules. I tested the Configuration Rule way; it is further down.
Before you switch it on, write down the time. You will want to switch it off as soon as the attack is over, for the reasons in the next two sections.
What Under Attack mode blocked on my WordPress test site
None of the top-ranking guides I read showed what Under Attack mode returns to non-browser clients. I tested it on a throwaway VPS that I deleted afterwards: WordPress on aaPanel, a test domain proxied through Cloudflare’s Free plan. This is the same lab I used for my error 526 and too many redirects tests.

The homepage: 403 with Cf-Mitigated: challenge
With the toggle on, I asked for the homepage with curl from my PC and printed only the response headers. The answer was HTTP/1.1 403 Forbidden, Server: cloudflare, and a header that tells you exactly why: Cf-Mitigated: challenge. The 5,222-byte body was Cloudflare’s challenge page, not WordPress. curl cannot run JavaScript, so for curl the 403 is the end of the road.

The feed, the REST API and wp-cron.php: 403
Next I asked for three URLs that WordPress uses for machines rather than people: /feed/ (RSS readers and email newsletters), /wp-json/ (the REST API that apps, the block editor and many plugins call) and /wp-cron.php (WordPress’s scheduled tasks). All three returned 403.

The server’s own cron request: 403
Then I ran curl on the server itself, asking for its own wp-cron.php?doing_wp_cron URL, the same kind of request WordPress makes to start its scheduled tasks. It also got 403. The domain points to Cloudflare, so even the server’s request to itself went out through Cloudflare and met the challenge.

What this test does and does not show
It shows that, on the Free plan, Under Attack mode answered every request I made without a browser with 403, including the server’s own loopback request. It does not show how long a real browser waits (I did not time it), how Googlebot or other search engine crawlers are treated (I did not test them, and Cloudflare’s Under Attack page does not say), or how well it stops a real DDoS attack. Those are not in my results.
What can break on WordPress while it is on
My test covered the feed, the REST API and cron. The rest of this list follows from the same rule (no JavaScript, no access), but I did not test each one, so treat it as what to check rather than what I saw.
| What | Why it is affected | In my lab |
|---|---|---|
| Scheduled posts, backups, plugin tasks (WP-Cron) | WordPress starts cron with a request to its own wp-cron.php through your domain | Tested: wp-cron.php 403, from my PC and from the server |
| RSS feed, feed readers, email newsletters built from the feed | They fetch /feed/ without a browser | Tested: /feed/ 403 |
| REST API: mobile apps, headless front ends, connected services | They call /wp-json/ without a browser | Tested: /wp-json/ 403 |
| Uptime monitors and status checks | A monitor sees the 403 and may report your site as down | Not tested |
| Payment and form webhooks (for example a shop’s payment gateway) | The provider’s server posts to your site and cannot pass a challenge | Not tested |
| Site Health loopback test, other plugins that call your own URL | Same path as the cron loopback | Not tested |
| Analytics | Cloudflare’s docs say analytics are affected | Not tested |
Logged-in work in a normal browser should keep working once the browser passes the check, but I tested only with curl. If a part of the site you rely on stops working while the mode is on, test that URL with the curl commands below before you blame a plugin.
Check what Cloudflare returns for your own URLs
▶ On your own computer, in Windows cmd (not PowerShell). On Mac or Linux, use curl instead of curl.exe and /dev/null instead of NUL:
curl.exe -s -o NUL -D - https://example.com/
What it does: requests your homepage through Cloudflare, throws the page body away (-o NUL) and prints the response headers (-D -). It changes nothing. Replace example.com with your domain. 403 plus Cf-Mitigated: challenge means Cloudflare’s challenge stopped the request; 200 (or a 301 or 302 from your own site) means it got through.
▶ On your own computer, in Windows cmd (not PowerShell). On Mac or Linux, use curl instead of curl.exe, /dev/null instead of NUL, and ; instead of &:
curl.exe -s -o NUL -w "feed %{http_code}\n" https://example.com/feed/ & curl.exe -s -o NUL -w "rest %{http_code}\n" https://example.com/wp-json/ & curl.exe -s -o NUL -w "cron %{http_code}\n" https://example.com/wp-cron.php
What it does: requests the feed, the REST API and wp-cron.php one after another and prints only the status code for each. It changes nothing. In cmd, & runs the next command after the previous one.
▶ On the server (SSH terminal):
curl -sS -o /dev/null -w "server loopback %{http_code}\n" "https://example.com/wp-cron.php?doing_wp_cron"
What it does: from the server, requests its own cron URL through your domain (and so through Cloudflare) and prints the status code. It can start any WordPress tasks that are due, which is what visiting that URL normally does; it changes no settings. 403 means WordPress cannot start its own cron while the mode is on.
Use Under Attack mode only on wp-login.php
If the attack is on your login page, which is common on WordPress (password guessing against wp-login.php), you do not need the check on every page. A Configuration Rule can turn Under Attack mode on for matching URLs only. I made one for /wp-login.php with the global toggle off.
- In your domain, open Rules, Overview, Create rule, and choose Configuration Rule. Give it a name, for example
UAM login only. - Under If incoming requests match, choose Custom filter expression, switch to the expression editor (Edit expression), and paste the expression below (with your domain).
- Under Then the settings are, find I’m Under Attack, click + Add, and switch its toggle on.
- Check that Rule validation passed appears next to the buttons, then click Deploy.
(http.host eq "example.com" and http.request.uri.path eq "/wp-login.php")
What it does: matches only requests for /wp-login.php on your domain. Pasting it changes nothing until you deploy the rule; deploying turns the check on for that one path.


Two things caught me out. The setting is called I’m Under Attack in the rule’s settings list, even though Cloudflare’s docs describe the rule as one that adjusts the Security Level. And my first try, with the expression but no setting added, would not deploy: Cloudflare said action parameters are required for the set_config action. In screenshots from that try that I have not published, all three test URLs still returned 200, because no rule was live.
With the rule deployed, the result was exactly what I wanted: home 200, login 403, cron 200. The homepage and wp-cron.php stayed at 200, and only wp-login.php got the challenge.

I tested only wp-login.php. A person logging in with a normal browser should pass the check first, but I checked the rule with curl, not with a browser login. If you use apps that log in through xmlrpc.php or the REST API, keep those paths out of the rule, or they would likely get the same 403 the feed got (I did not test xmlrpc.php).
Keep WP-Cron running while Under Attack mode is on
If you have to keep the global toggle on for hours, scheduled posts and plugin tasks will not run, because WordPress can no longer reach its own wp-cron.php (the 403 above). The usual way around it is to run cron from the server itself, without an HTTP request through Cloudflare. I did not test this on the lab server; it is the standard WordPress setup, not a Cloudflare feature.
Do the steps in this order, so cron is never left with no trigger.
1. ▶ On the server (SSH terminal), as root, open the crontab of the user that owns the site (www on aaPanel):
crontab -u www -e
What it does: opens that user’s scheduled jobs in an editor (changes nothing until you save). If it asks which editor to use, pick nano. Add this line, using your site’s folder and PHP path (on aaPanel with PHP 8.4 it is /www/server/php/84/bin/php), then save (in nano: Ctrl+O, Enter, Ctrl+X):
*/5 * * * * cd /www/wwwroot/example.com && /www/server/php/84/bin/php wp-cron.php > /dev/null 2>&1
What it does: every five minutes, runs wp-cron.php directly with PHP on the server, so due tasks run even while Cloudflare challenges every HTTP request (changes the server’s schedule). On shared hosting, add the same kind of job in your host’s Cron Jobs page instead.
2. ▶ In wp-config.php (in the site’s folder, /www/wwwroot/example.com/ on aaPanel), above the line /* That's all, stop editing! */ (changes how WordPress starts cron; back up the file first):
define( 'DISABLE_WP_CRON', true );
What it does: stops WordPress from trying to start cron on page loads, so the job above is the only trigger. If you remove this line later, also remove the cron job.
Under Attack mode vs Bot Fight Mode, WAF rules and rate limiting
Under Attack mode is the bluntest tool Cloudflare gives you. These are the options people compare it with; I tested only the first two rows.
| Option | What it does | Best for | In my lab |
|---|---|---|---|
| Under Attack mode (global toggle) | Challenge for every visitor; clients without JavaScript get 403 | An attack that is taking the site down right now | Tested: home, feed, REST API, cron 403 |
| Under Attack mode in a Configuration Rule | The same check, only on URLs that match the rule | Login floods on wp-login.php | Tested: login 403, home and cron 200 |
| WAF custom rule with a challenge action | Challenges requests you choose by path, country, ASN or other fields | Ongoing protection of login or other busy paths | Not tested |
| Bot Fight Mode | Challenges traffic Cloudflare classes as bots | Background bot noise | Not tested |
| Rate limiting rule | Blocks a client that sends too many requests in a time window | Password guessing, API abuse | Not tested |
Plan limits for custom rules and rate limiting change, so check what your plan includes in the Cloudflare dashboard. My Cloudflare settings for WordPress guide covers the security settings I keep on all the time on the Free plan; Under Attack mode is not one of them.
Development Mode, which often shows up next to it in searches, is not a security setting at all. It only bypasses Cloudflare’s cache for a while so you can see changes on your server straight away. If you are trying to understand cache headers instead, my cf-cache-status guide explains them.
Why am I being blocked by Cloudflare? (for visitors)
If you are a visitor and you keep seeing “Performing security verification” or “Just a moment”, the website has asked Cloudflare to check visitors, often with Under Attack mode during an attack. You did nothing wrong. Things that commonly stop the check from passing on your side:
- JavaScript is turned off, or a script blocker or privacy extension is blocking the check. Allow it for that site or try a private window without extensions.
- Cookies are blocked for the site, so the browser cannot keep the pass and gets checked again.
- A VPN or a shared network has a bad reputation. Try without the VPN.
If none of that helps, only the site owner can change it. A challenge page is a site setting, not a Cloudflare outage. If many unrelated sites are failing at once, check Cloudflare’s public status page (cloudflarestatus.com) instead.
When to turn Under Attack mode off
Cloudflare itself calls Under Attack mode a last resort, and my test shows why: while it is on, everything that is not a browser stops at the door. I use this checklist:
- Turn it off when the attack is over. Watch your server load and Cloudflare’s Security analytics; when the flood stops, switch the toggle off.
- Use the narrowest rule that works. If the attack is on
wp-login.php, use the login-only rule instead of the global toggle. - After switching off, test again with curl. The feed,
/wp-json/andwp-cron.phpshould return 200. - Check what missed its schedule. Scheduled posts and backups that should have run while the mode was on may need a manual run.
- Fix the cause. If ordinary traffic took the server down, look at caching and the server size; my Cloudflare error guides (522, 524, 520) show what an overloaded or slow origin looks like.
Cloudflare Under Attack mode FAQ
How do I turn on Under Attack mode in Cloudflare?
Open your domain in the Cloudflare dashboard and switch on Under Attack Mode in the Quick Actions panel on the overview page. It works on the Free plan. To protect only one path, such as wp-login.php, use a Configuration Rule with the I’m Under Attack setting switched on.
Does Under Attack mode block the WordPress REST API and RSS feed?
In my test, yes. With the mode on, wp-json, the feed and wp-cron.php all returned 403 to curl, because those clients cannot run the JavaScript challenge. A login-only rule kept the homepage and wp-cron at 200.
How long does the Under Attack challenge take?
Cloudflare says the check finishes within five seconds. I did not time it in my test. After a visitor passes, they are not checked again until the Challenge Passage time runs out.
Should I leave Under Attack mode on all the time?
No. Cloudflare calls it a last resort. In my test it blocked the feed, the REST API and wp-cron.php, it can make uptime monitors report the site as down, and Cloudflare says it affects analytics. Turn it on during an attack and off afterwards, or limit it to the login page with a rule.
How do I whitelist my server or a service?
Cloudflare IP Access Rules work by IP range, country or ASN. I did not test using one to let a server or service through. For WordPress cron, running wp-cron.php from the server with a cron job avoids the problem without any Cloudflare change.
Does Under Attack mode hurt SEO or block Googlebot?
I did not test search engine crawlers, and Cloudflare’s Under Attack page does not say how they are treated. To be safe, keep the mode on only as long as the attack lasts, or use the login-only rule, which left the homepage at 200 in my test.
Does Under Attack mode stop a DDoS attack?
It is designed to filter layer 7 floods of page requests by making each client pass a browser check. I did not test it against a real attack, so I cannot say how well it holds up.
Is there a problem with Cloudflare right now?
A challenge page on one site is that site’s setting, not an outage. If many sites behind Cloudflare fail at the same time, check Cloudflare’s public status page.
What is the difference between Under Attack mode and Development Mode?
Under Attack mode challenges visitors for security. Development Mode only bypasses Cloudflare’s cache for a while so you see changes on your server straight away. They are unrelated.
