Docs
← Back to site

WAF RulesUpdated

9 min readUpdated November 18, 2026

The WAF Rules screen builds five Cloudflare custom firewall rules from switches and deploys them to as many zones as you like. The rules follow the five-rule set by Troy Glancy, refined by Michael Bourne at wafrules.com. WP WAF Manager 1.0.27.1 uses the October 24, 2026 release; the date is shown at the top of the screen under Rules last updated.

Go to WAF Manager → WAF Rules. The screen has four tabs: Configure Rules, Expressions, Details and Zone Rules.

WAF Rules screen in the WordPress admin with the WAF Manager menu open

Token permissions: Zone → Zone WAF → Edit and Zone → Zone → Read.

How the rules work together#

# Rule Action What it catches
1 Allow Good Bots Skip Cloudflare verified bots, services with a published IP list, your server IPs, user agents and expressions you add
2 Block Aggressive Crawlers & WordPress Paths Block Persistent bots, curl, exploit scanners, WordPress attack paths and exposed files
3 Block or Challenge Web Hosts / TOR & Exploit URIs Block or Managed Challenge Hosting networks, attack networks, TOR, and exploit patterns in the URL from any IP
4 Challenge Large Providers / Country Managed Challenge AWS, Google Cloud, Azure and, if you choose, countries you don’t serve
5 Challenge VPN Connections & wp-login Managed Challenge Known VPN networks and the WordPress login page

The order is fixed. Rule 1 runs first and lets allowed traffic skip everything after it. Block rules run before Challenge rules because a blocked request stops there. Inside a rule, any ticked condition is enough to match.

Turn a whole rule off with the switch on its card. Click a card’s header to fold it away. The Details tab lists the five rules with their actions.

Rule 1: Allow Good Bots#

Rule 1, Allow Good Bots, with verified bots, published IP lists, other allowances and your server IPs

Allowed traffic skips all remaining custom rules, all rate limiting rules, all Super Bot Fight Mode rules, Zone Lockdown, User Agent Blocking, Browser Integrity Check, Hotlink Protection and Security Level. The plugin sets this up when it deploys. Managed rules are deliberately not skipped, so Cloudflare’s emergency patches for new vulnerabilities still protect allowed traffic.

Cloudflare verified bots#

Allow every Cloudflare verified bot (on by default, recommended) adds cf.client.bot, which matches every bot Cloudflare has verified. This covers search engines, uptime monitors, SEO tools, security scanners, link previews and webhook senders.

Turn it off to allow only the categories you pick. The categories are used only while that switch is off. Their defaults: Accessibility, Academic Research, Advertising & Marketing, Feed Fetcher, Monitoring & Analytics, Page Preview, Search Engine Crawler, Search Engine Optimization, Security and Webhooks are on; Aggregator, AI Assistant, AI Crawler, AI Search, Archiver and Social Media Marketing are off.

Covered by Cloudflare verified bots lists services that need no switch of their own, such as GTmetrix, Pingdom, UptimeRobot, BlogVault, Ahrefs, Semrush Site Audit, Sucuri, Wordfence, Jetpack and MainWP. Each line shows whether your current choice covers them.

Services with a published IP list#

Each switch adds the IP addresses the service publishes. Turn one on when the service is not a Cloudflare verified bot, or when another rule would challenge its network, such as AWS in Rule 4 or Hetzner in Rule 3. All are off by default.

Service Why you’d turn it on
Better Stack Already a verified bot. Adds its optional IP list
ManageWP Its backups run on AWS, which Rule 4 challenges
SEMrush Already a verified bot. Adds the optional Site Audit range
EWWW Image Optimizer, Easy IO CDN The Easy IO / ExactDN origin servers
Imagify Its optimization servers
ShortPixel Runs on Hetzner, which Rule 3 blocks
Patchstack Its scanners; Patchstack says the list may change without notice
WP Umbrella Management, uptime, broken-link and Lighthouse checks; it doesn’t verify as a Cloudflare bot
GoSweetSpot Webhooks and order fetches

Each switch shows how many IPs it adds and when the list was last checked.

Other allowances#

  • Allow Let’s Encrypt verification (on) matches paths starting with /.well-known/acme-challenge/, so SSL renewals never fail.
  • Apple Messages link previews (on) allows GET requests whose user agent contains facebookexternalhit. iMessage fetches previews from the sender’s own device, so only the user agent can be matched.
  • FlyingPress (off) allows GET requests with the FlyingPress user agent. FlyingPress publishes no IPs.

Can’t be allowlisted safely: Cloudflare Image Resizing, TinyPNG and UpdraftPlus publish no IP addresses. BackupBuddy and Screaming Frog run from your own server or office: enter that address under Your server IPs.

Your own allowlists#

  • Your server IPs: this site’s own servers (loopback, cron and cache-preload requests) and any other IP you trust. One IPv4, IPv6 or CIDR per line, for example 203.0.113.10, 10.0.0.0/8 or 2001:db8::/32. Invalid lines are dropped when you save.
  • Custom User Agents to Allow: one per line. Any user agent containing the text matches. A user agent is easy to fake, so use an IP when the service publishes one. Find blocked user agents in Cloudflare under Security → Analytics → Events.
  • Custom Allow Expressions: one Cloudflare rule expression per entry, without a leading or; parentheses are added for you. Click + Add Expression for more. Example: starts_with(http.request.uri.path, "/surecart/webhooks"). An invalid expression makes the deploy fail for that zone.
Info

Updating from a version before 1.0.25? Services that used to be allowed by user agent and publish no IP list, such as UpdraftPlus, BackupBuddy and TinyPNG, were moved to Custom User Agents to Allow for you. A notice on the screen lists what was moved.

Rule 2: Block Aggressive Crawlers & WordPress Paths#

Rule 2, Block Aggressive Crawlers and WordPress Paths, with curl blocking and path switches
Section Options (default)
Aggressive Crawlers Yandex, Sogou, SEMrush, Ahrefs, Baidu (off); Neevabot (on)
Generic Bot Patterns Python Requests; “crawl”, “bot” or “spider” in the user agent (all on). They never match Cloudflare verified bots
curl Block curl user agents (on), with Except these hostnames
Exploit Scanners Nikto, SQLMap, Masscan, Nmap (all on)
WordPress Path Protection Block XML-RPC, Block wp-config, Block install.php, Block WLW Manifest, Block readme.html, Block license.txt, Sensitive file exposure (on); Block WP-JSON (REST API), Block wp-cron.php (off)

Block curl user agents stops scripts that call your site with curl. Turn it off for app or API hosts, such as Workers, Vercel or webhook endpoints, where people or scripts call you with curl on purpose. To keep it on but let one host through, list it under Except these hostnames, one per line. Allow server-side monitors in Rule 1 instead.

Sensitive file exposure blocks probes for .env, .git, composer.json, composer.lock, debug.log, phpunit and server-status.

Yandex, Sogou and Baidu are verified search engines, and SEMrush and Ahrefs are verified SEO bots. While Rule 1 allows them, ticking them here does nothing. To block one, turn off Allow every Cloudflare verified bot in Rule 1 and untick its category there.

Take care with three paths:

  • Block WP-JSON (REST API) breaks the block editor, WooCommerce, many plugins and mobile apps. Leave it off unless the site never uses the REST API.
  • Block XML-RPC breaks the Jetpack app and anything that posts over XML-RPC.
  • Block wp-cron.php breaks scheduled tasks where a server cron calls wp-cron.php over HTTP.

The exploit patterns that used to be in Rule 2 moved to Rule 3 in 1.0.25.

Rule 3: Block or Challenge Web Hosts / TOR & Exploit URIs#

Rule 3, Block or Challenge Web Hosts, TOR and Exploit URIs, with all its options

Real visitors rarely browse from a data center, but bots and attack tools often do.

Block Web Host ASNs (on) matches traffic from DigitalOcean, Linode (Akamai), Vultr, Hetzner, OVH, Contabo, Scaleway, DreamHost, M247, LeaseWeb, GoDaddy, Alibaba, HostRoyale and Cloudvider. Untick a provider to allow it. Verified bots and certificate checks are never matched.

Attack Hosting Networks stay in the rule even when Block Web Host ASNs is off. Untick one only if you need traffic from it:

  • AS48090 TECHOFF SRV / DMZHOST: exploit spray and credential probing.
  • AS211590 Bucklog / FBW Networks: secrets scanning.
  • AS218785 TC Datacenter: WordPress exploit traffic.

Block TOR Exit Nodes (on) matches traffic from the TOR network.

Exploit URI Patterns match any visitor IP, not only web hosts or TOR. They sit in this rule to stay within the Free plan’s five custom rules. All six are on:

Switch Blocks
Path traversal / LFI ../, etc/passwd, encoded traversal and null bytes
Legacy / scanner exploit paths Samba CGI, story.pl, Synology Webman and similar fingerprints
Non-WordPress CMS / admin probes SPIP, Symphony, Temenos, Sympa and generic CMS login queries
Time-delay / blind SQLi primitives pg_sleep, sleep(, benchmark(, waitfor delay
Union / schema SQLi probes union select, information_schema and similar
Reflected XSS probes Script tags, javascript: URLs and event-handler payloads

Under Action, choose Block (recommended) or Managed Challenge. Switch to Managed Challenge if real users reach you through business proxies, hosted desktops or TOR.

Rule 4: Challenge Large Providers / Country#

Rule 4, Challenge Large Providers and Country, with AWS, Google Cloud and Azure

Cloud Providers (all on): Amazon AWS (AS16509, AS14618, AS7224), Google Cloud (AS15169, AS396982) and Microsoft Azure (AS8075). Verified bots are never challenged.

Country Restriction: tick Challenge visitors from outside your selected countries and a country picker opens below the card. Select every country you want to allow. Visitors from anywhere else get a managed challenge.

Rule 4 country picker with the North America and Europe quick picks selected
  • Search by country name or two-letter code.
  • Click a Quick Pick to add or remove a whole region: North America, Europe, Asia, Oceania, Latin America, MENA, GCC or Africa.
  • Select All selects the countries currently shown. Clear All clears the list.

Leave the country option off for sites with a worldwide audience.

Rule 5: Challenge VPN Connections & wp-login#

Rule 5, Challenge VPN Connections and wp-login, with its VPN providers

Challenge All VPN Connections (on) covers NordVPN, ExpressVPN, PureVPN, Surfshark, IPVanish, QuadraNet, OVH France, Internet Utilities, Mullvad VPN and Private Layer. Untick it to choose providers one by one.

WordPress Login (wp-login.php) (on) shows a managed challenge to everyone who opens the login page. Real users pass with one click or none. Bots trying passwords are stopped.

Save, reset and export#

Bottom bar with Save, Reset All Settings to Default, Export Settings, Import Settings and Deploy Rules to Your Sites
  • Save saves the settings to the active Rule Profile. The button shows the profile’s name, such as Save: Default.
  • Reset All Settings to Default puts every option back to its default on screen. Nothing is saved until you click Save.
  • Export Settings downloads the settings as a JSON file.
  • Import Settings loads a JSON file exported by the plugin and saves it.
  • Deploy Rules to Your Sites opens the deploy panel.

To keep several setups, use Rule Profiles. See Profiles Overview.

Deploy#

Click Deploy Rules to Your Sites, tick the zones and click Deploy to N Zones. The five rules go first in each zone’s custom rules; rules you made in Cloudflare are kept after them unless you tick Replace all custom rules in the zone. See Deploying Rules to Your Sites for the full steps and results.

Expressions tab#

Shows the exact Cloudflare expression for each enabled rule, with its action, its length against Cloudflare’s 4,096-character limit, and a Copy button. Click Refresh after changing settings. Use it to check a rule before deploying, or to paste a rule into Cloudflare by hand.

Expressions tab with the generated Cloudflare expression for each rule and its length

Zone Rules tab#

Choose a zone and click Load Rules to see every custom rule live on it, including rules the plugin didn’t create. Each rule shows its name, action, whether it’s active, and its expression. The tab is read-only.

Share:

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