Docs

Cloudflare WAF

8 min readUpdated November 19, 2026

The Cloudflare WAF tab stops login floods and known attackers on Cloudflare’s edge, so their requests never reach your server. It is the third sub-tab of Edge Blocking, next to IP Blocking and Bunny Shield, and needs version 1.0.13 or later.

IP Blocking reacts after the fact: an IP fails too many logins, Nahnu Login Shield locks it out, then asks Cloudflare to block it. The Cloudflare WAF tab adds a rate limit that blocks a flood while it is still happening. This topic applies only to sites that run through Cloudflare (orange-cloud proxied DNS).

What it does#

  • Login rate limit. One switch adds a Cloudflare rate limiting rule that blocks any IP sending too many requests to your login pages. It covers wp-login.php, xmlrpc.php and your custom login path.
  • Blocked IPs. Every IP Nahnu Login Shield has blocked on Cloudflare is listed with an Unblock button.
  • Blocked networks. Block network… on an active lockout blocks the attacker’s whole hosting network (its AS number). Works on every Cloudflare plan, including Free.
  • Zone check. The tab shows your Cloudflare plan, warns you when the zone is paused, and names any API token permission that is missing.

Nahnu Login Shield talks to the Cloudflare API directly. No other plugin is needed.

Before you start#

  • A Cloudflare connection. The tab uses the same API token and zone as IP Blocking. Set those up first (see “Block at the edge with Cloudflare”).
  • The right token permissions. Edit your token in Cloudflare under My Profile → API Tokens and make sure it has:
PermissionNeeded for
Zone → Zone → ReadReading the zone and its plan (usually allowed already)
Zone → Firewall Services → EditBlocked IPs and blocked networks (IP Access Rules)
Zone → Zone WAF → EditThe login rate limit (new in 1.0.13)
  • Know your plan. What you can change depends on your Cloudflare plan:
FreeProBusiness and up
Login rate limitFixed: more than 10 requests in 10 seconds blocks the IP for 10 secondsYour own requests, a window of 10 seconds or 1 minute, a block up to 1 hourWindow up to 10 minutes (1 hour on Enterprise), block up to 1 day
Rate limiting rules allowed125 or more
Blocked IPsYesYesYes
Blocked networksYesYesYes

Plans and limits are Cloudflare’s and can change. See Cloudflare’s rate limiting rules page for the current list.

Set it up#

  1. Go to Settings → Nahnu Login Shield → Edge Blocking.
  2. On the IP Blocking sub-tab, paste your Cloudflare API token, choose your zone, and turn on Enable Cloudflare blocking. Click Save Cloudflare settings.
  3. Open the Cloudflare WAF sub-tab. It loads right after you save, with no page reload.
  4. Check the Cloudflare zone badge. It should say Active and show your plan. If a warning appears below it, see “Warnings and messages”.
  5. Turn on Rate-limit the login endpoints at the Cloudflare edge. The status changes to On once the rule exists in Cloudflare.
  6. On Pro and higher plans, adjust the limits if you like and click Save changes.

That’s it. Blocked IPs and networks need no setup. If the tab says Connect Cloudflare first, the token or zone isn’t saved yet. Click Go to IP Blocking.

A Cloudflare WAF web interface panel displays settings for login rate limiting and blocked networks. The page features toggle switches, informational text boxes with highlighted code paths, and input fields for configuring IP and network protection.

Login rate limit#

The rate limit counts requests per IP to your login pages and blocks an IP that goes over the limit. Cloudflare does the counting and blocking, so a flood never reaches PHP or your database.

It covers /wp-login.php, /xmlrpc.php and your custom login path, with and without its trailing slash. Subdirectory installs are covered too (for example /blog/wp-login.php). When you change the custom path on the General tab, the rule is updated in Cloudflare automatically.

On the Free plan the limits are fixed at what Cloudflare allows: more than 10 requests in 10 seconds blocks the IP for 10 seconds, the longest block the Free plan allows. That is enough to break up an automated flood. The tab says so, and there is nothing to adjust.

On Pro and higher plans you choose:

  • Requests: how many requests an IP may make before it is blocked. The default is 10.
  • Per: the time window. Only the windows your plan allows are listed.
  • For: how long the IP stays blocked. Only the lengths your plan allows are listed. The default is 5 minutes.

The rule is added to your zone’s rate limiting rules, after any you already have. Your own rules are never changed or removed. It shows in Cloudflare under Security → WAF → Rate limiting rules as Nahnu Login Shield: login rate limit. Manage it from this tab rather than in Cloudflare. Turning the switch off removes only this rule, after you confirm.

If the status says Needs update, your login paths, limits or plan changed since the rule was saved. Click Save changes.

The Free plan allows only one rate limiting rule. If you already have one, Cloudflare refuses a second and the tab shows Cloudflare’s message. Remove or edit your own rule in Cloudflare first, or keep yours.

Blocked IPs#

Locked-out IPs are blocked with Cloudflare IP Access Rules, as on the IP Blocking tab. The Cloudflare WAF tab lists them so you can see and lift them in one place.

What gets blocked follows the IP Blocking settings: Enable Cloudflare blocking must be on, and the Honeypot username and Brute-force lockout triggers decide which events send an IP.

  • Listed on the tab. Blocked IPs shows each IP, a count, and how long until the block ends, soonest first.
  • Removed on time. Each block ends after the Block duration set on the IP Blocking tab.
  • Removed on unlock. Unlocking an IP on the Lockout tab lifts its Cloudflare block right away. Unblock on the Cloudflare WAF tab does the same.
  • No duplicates. If an IP that is already blocked trips a lockout again, the existing block is kept.

Entries also appear in the edge block log with the provider Cloudflare (see “The edge block log”).

Blocked networks#

Attackers switch IPs but usually stay on the same hosting network. Blocking that network’s AS number stops every IP on it at the Cloudflare edge. This uses IP Access Rules, so it works on every Cloudflare plan, including Free.

  1. Go to the Lockout tab and find the IP under active lockouts.
  2. Click Block network…. Nahnu Login Shield looks up the IP’s network and shows its AS number, name and IP range.
  3. Confirm. The network is blocked on every edge provider you have connected: Cloudflare, and Bunny Shield too if your Bunny plan is Advanced or higher.

You can also enter an AS number under Blocked networks (ASNs) on the Cloudflare WAF tab and click Block network. That blocks it on Cloudflare only. Blocked networks are listed there, each with an Unblock button, and stay blocked until you unblock them.

Be careful with networks real visitors use, such as mobile carriers and large cloud providers. Blocking one blocks everyone on it.

The lookup asks Team Cymru’s free IP-to-ASN service over DNS. It sends only the IP address, and only when you click Block network….

Warnings and messages#

The tab shows warnings under the Cloudflare zone badge. Click Refresh next to the badge to re-check after changing something in Cloudflare.

MessageWhat it meansWhat to do
This zone is paused in CloudflareCloudflare passes traffic straight to your server and blocks nothing, including these rules.Resume Cloudflare on the zone’s Overview page in Cloudflare.
Add the permission Zone → Zone WAF → Edit to your API tokenThe token can’t read or change rate limiting rules.Edit the token in Cloudflare, add the permission, then click Refresh.
Add the permission Zone → Firewall Services → Edit to your API tokenThe token can’t create IP Access Rules, so IPs and networks can’t be blocked.Edit the token in Cloudflare, add the permission.
Your login paths or limits changed and the rule is out of dateThe rule in Cloudflare no longer matches your settings.Click Save changes.

Any other error comes straight from Cloudflare, so the tab shows exactly what Cloudflare refused.

If an IP is blocked by mistake#

  • On the blocked IPs list: click Unblock next to it on the Cloudflare WAF tab, or unlock it on the Lockout tab (see “Unlock an IP”). Either one removes it from Cloudflare.
  • On a blocked network: click Unblock next to the network under Blocked networks (ASNs).
  • Hit by the rate limit: wait it out. The block ends on its own after the block time (10 seconds on the Free plan). These blocks live only in Cloudflare, so they don’t show on the tab.

The rate limit runs in Cloudflare and doesn’t know your Lockout allowlist. If you or a tool such as an uptime monitor calls the login page often, keep it under the limit, or raise the limit on Pro and higher plans.

Good to know#

  • Your own rules are safe. The plugin only adds, updates and removes its own rate limiting rule and the access rules it created.
  • Cached login pages. If you cache HTML with Cloudflare Cache Rules and use a custom login path, add a rule that bypasses the cache for that path. The tab reminds you when a custom path is set.
  • Needs WP-Cron. Blocks are lifted on time by a scheduled task, and lockout pushes run in the background.
  • The real visitor IP. Behind Cloudflare, turn on Trust proxy headers on the Lockout tab so lockouts use the visitor’s IP, not Cloudflare’s.
  • Edge blocks skip WordPress. Requests stopped by Cloudflare never reach your site, so they’re not in Nahnu Login Shield’s logs. Check Security → Events in Cloudflare.
  • Uninstalling leaves Cloudflare alone. Deleting the plugin removes its settings but not what it created in Cloudflare. Turn off the rate limit, and unblock your networks and any blocked IPs first, if you no longer want them. Once the plugin is deactivated, its IP blocks in Cloudflare are no longer lifted on time.

Was this helpful?

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only