One of the most frustrating bottlenecks in generative search optimization is discovering that your robots.txt is completely open, yet AI search engines report your website as inaccessible. In many of the blocked-crawler cases we audit, the blocker is not the origin web server — it is Cloudflare's bot protection returning HTTP 403 or challenges to automated crawlers.
Why Cloudflare Challenges Fail AI Search Bots
When an end user asks ChatGPT or Perplexity for purchase advice or documentation references, the AI engine triggers a real-time retrieval crawler (OAI-SearchBot or PerplexityBot). Because these crawlers operate under tight retrieval latency budgets (our Perplexity teardown uses ~1.5 seconds as a working heuristic — Perplexity latency breakdown), they cannot solve Turnstile interactive puzzles or wait for JavaScript hydration shells. Cloudflare interprets this timeout as a failed challenge and drops the connection.
Creating a WAF Custom Skip Rule
To allow legitimate AI search crawlers without turning off Bot Fight Mode for malicious scrapers, configure a Cloudflare Custom WAF Rule:
- Log in to your Cloudflare Dashboard and select your domain.
- Navigate to Security > WAF > Custom Rules.
- Click Create Rule, name it
Allow AI Search Crawlers, and paste the expression below:
(http.user_agent contains "OAI-SearchBot" or http.user_agent contains "GPTBot" or http.user_agent contains "ChatGPT-User" or http.user_agent contains "PerplexityBot" or http.user_agent contains "ClaudeBot" or http.user_agent contains "Claude-SearchBot" or http.user_agent contains "Claude-User")
Note: UA-only matching is spoofable — combine with published IP ranges (see below). Applebot-Extended was removed because it is a robots.txt control token, never a UA; allow Applebot/Googlebot via the verified-bot path instead.
Important: on the Free plan, Bot Fight Mode cannot be skipped at all — see the next section for your options.
Under the Choose Action dropdown, select Skip, and check the following security components to bypass:
- All Super Bot Fight Mode rules (phase
http_request_sbfm) - WAF Managed Rules (phase
http_request_firewall_managed) - Browser Integrity Check (product
bic) - Security Level (product
securityLevel)
First: Which Bot Protection Is Actually Running?
The skip-rule recipe below only works on the right product, and this is where most tutorials send you in circles. Cloudflare's docs are explicit: Bot Fight Mode (Free plan) cannot be bypassed or skipped with WAF custom rules or Page Rules, because it runs outside the Ruleset Engine — Skip, Bypass and Allow actions have no effect on it. Identify your layer first:
- Bot Fight Mode (Free): your options are (a) turn it off under Security → Settings, (b) add IP Access Allow rules for the bots' published IP ranges — BFM will not trigger when an IP Access rule matches the request first — or (c) upgrade to Super Bot Fight Mode.
- Super Bot Fight Mode (Pro+): runs in the
http_request_sbfmphase and can be skipped with a custom rule. This is what the recipe below targets. - AI Crawler and Agent access policies: under Security → Settings → Bot traffic, Search / Agent / Training each carry their own action. A policy set to Block 403s matching crawlers even when robots.txt allows them — and defaults have shifted over time, so inspect your zone rather than assuming. With Bot Preference Sync enabled, a Training Disallow also edge-blocks training crawlers and prepends managed directives to your robots.txt.
Harden the Expression: User-Agent + IP
A UA-only rule is an open door: anyone can send User-Agent: OAI-SearchBot and inherit your skip. Perplexity's own documentation recommends combining the UA with its published IP ranges, and every major vendor publishes machine-readable lists: OpenAI (openai.com/searchbot.json, gptbot.json, chatgpt-user.json), Perplexity (perplexity.ai/perplexitybot.json, perplexity-user.json), Anthropic (claude.com/crawling/bots.json). Pattern:
(http.user_agent contains "OAI-SearchBot" and ip.src in {<ranges from searchbot.json>})
or (http.user_agent contains "PerplexityBot" and ip.src in {<ranges from perplexitybot.json>})
or (http.user_agent contains "Claude-SearchBot" and ip.src in {<ranges from bots.json>})
Replace the placeholders with the current ranges (space-separated CIDRs) and re-check them periodically — vendors update the lists. On plans with bot scoring you can additionally gate on cf.client.bot (Cloudflare-verified bots). Note that control tokens like Applebot-Extended and Google-Extended never appear as user-agents — they belong in robots.txt, not WAF expressions; the actual crawlers are Applebot and Googlebot.
Skip the Right Components: Phases vs Products
Cloudflare splits skip targets into two buckets, and skipping one does not skip the other:
- Phases (Ruleset Engine):
http_request_sbfm(All Super Bot Fight Mode rules),http_request_firewall_managed(All managed rules),http_ratelimit(All rate limiting rules). - Products (outside the Ruleset Engine): Browser Integrity Check (
bic), Security Level (securityLevel), User Agent Blocking (uaBlock), Zone Lockdown (zoneLockdown), Hotlink Protection (hot).
For AI retrieval bots, skip the SBFM phase plus Browser Integrity Check and Security Level at minimum; add managed rules and rate limiting if your logs show those phases challenging the bots. DDoS protection is not a skippable product and stays on — you are not "disabling Cloudflare security."
Edge Cases That Still Break Retrieval
- The rules files themselves get challenged. If
/robots.txt,/llms.txtor your sitemap returns a challenge page, crawlers can't even read your permissions. Extend the skip expression withor http.request.uri.path in {"/robots.txt" "/llms.txt" "/sitemap.xml"}. - "I'm Under Attack" mode (Security Level essentially high) challenges everyone — schedule it off, or exempt the bot paths above.
- AI Labyrinth, if enabled, feeds non-compliant crawlers a maze of generated content. Verify your allowed bots aren't being routed into it.
- Rule order: place the skip rule first in the custom ruleset so a terminating Block/Challenge rule doesn't fire before it.
- Stale cache: a cached challenge response can outlive your fix — purge and re-test from outside your own network.
Verify From Outside, Then Watch the Logs
In Security → Events (Security Events), filter by the bot's user-agent and confirm the action reads Skip with edge status 200 — not Managed Challenge or Block. Then reproduce it yourself: curl -A "<documented bot UA>" -s https://yoursite.com/ | wc -c from a machine outside your network should return the full page, byte-for-byte comparable to a browser fetch. OpenAI notes ~24 hours for robots.txt-side changes to propagate, so give the engines a day before judging citation impact — and re-run the 12-bot crawlability audit after every security-policy change. WordPress-specific plugin conflicts are covered in the WordPress AEO guide.
Verifying with Live Request Logs
Navigate to Security > Analytics & Logs. Trigger a test search in ChatGPT or use our free diagnostic tool. Filter by User Agent: OAI-SearchBot and verify that requests return HTTP 200 OK with action Skip rather than Managed Challenge.
Test Your Edge WAF in Real Time
Run our automated 12-crawler crawlability diagnostic to verify your Cloudflare WAF allows AI search crawlers.