Cloudflare can block AI crawlers from your site even when every crawler toggle is off
For anyone with a site behind Cloudflare who wants AI crawlers to read it: Cloudflare can return 403 to GPTBot, ClaudeBot and CCBot while the per-crawler Block switches are all off, and it can add its own block rules to the top of your robots.txt. Turn off Bot Preference Sync, set the Training access policy to Allow, then check each crawler with curl.
- Issue
- #11
- Published
- Reading time
- 3 min
- Stack
- Cloudflare, robots.txt, curl
The story
I was getting a small static landing site ready to launch. The site is served through Cloudflare, and I wanted search engines and AI tools to be able to read it. My repo's robots.txt was four lines: allow everything, plus a link to the sitemap. Then a check of the live site showed two things I hadn't set up. The robots.txt that Cloudflare served started with its own rules: an ai-train=no signal and Disallow: / groups for AI crawlers, placed above my four lines. And when I fetched the homepage with the user agent of an AI training crawler (GPTBot, ClaudeBot, CCBot, PerplexityBot), Cloudflare answered 403 "Your request was blocked." Crawlers that fetch a page on a user's behalf, like ChatGPT-User and Claude-User, got 200.
The obvious place to look was Cloudflare's AI crawler page, which has a Block Crawler switch for each bot. Every switch was off, yet the 403s kept coming. The blocks came from two other settings.
Why I'm sharing this
If you decide you want AI tools to find and quote your site, you'll probably check your own robots.txt and the per-crawler switches, see that nothing blocks the crawlers, and assume they can read the site. Meanwhile Cloudflare keeps turning them away. Nothing in your repo shows it, and the switches you checked say the crawlers are allowed.
The fix
- robots.txt: in the Cloudflare dashboard, on the page that manages robots.txt, turn off Enable Bot Preference Sync. Cloudflare's own description says it "prepends your robots.txt with your configured Cloudflare settings". With it off, the live file matched the repo's four lines.
- The 403s: go to Security → Settings → Bot traffic → AI Crawler and Agent access policies. Mine had Search set to Allow and Training set to Disallow. Training covers the crawlers that train AI models (GPTBot, ClaudeBot, CCBot), and that policy caused the 403s. I changed Training to Allow (do not block). Bot Fight Mode and AI Labyrinth were already off, so I didn't touch them.
- Check: fetch the page with each crawler's user agent (
curl -A "<user agent>") and read the status code. Afterwards every bot I tried returned 200: GPTBot, ClaudeBot, CCBot, PerplexityBot, Google-Extended, Applebot-Extended, OAI-SearchBot, Claude-SearchBot, ChatGPT-User, Claude-User, Googlebot and bingbot. Then load/robots.txtand confirm it holds only your own lines.
A curl test only shows what Cloudflare does with the user agent string. A real crawler is also checked by its IP address, so treat a 200 here as "no longer blocked by user agent", not as proof that the crawler has visited.
Use it in your workflow
My site is served through Cloudflare. Check whether Cloudflare blocks AI crawlers in ways my repo can't show:
1. Fetch https://<my-domain>/robots.txt and compare it with the robots.txt in my repo. Point out any lines the repo doesn't have, such as ai-train=no or Disallow groups for AI bots.
2. For each of these user agents, run curl -s -o /dev/null -w "%{http_code}" -A "<UA>" https://<my-domain>/ and print a table of status codes: GPTBot, ClaudeBot, CCBot, PerplexityBot, Google-Extended, OAI-SearchBot, ChatGPT-User, Claude-User, Googlebot, bingbot.
3. If robots.txt has extra lines, tell me to turn off "Enable Bot Preference Sync". If any crawler gets a 403, tell me to check Security > Settings > Bot traffic > "AI Crawler and Agent access policies" (the Training policy), not only the per-crawler Block switches.
Don't change any setting yourself.