...
-

September 16.2026

Blocked by Robots.txt: A Cloudflare Case Study and Fix

-

“Blocked by robots.txt” in Google Search Console does not always mean your robots.txt is wrong – it can also mean Google never managed to fetch the file, or that a crawler you have never heard of is being challenged by your firewall. We just worked through both failure modes on a large e-commerce site behind Cloudflare: a WAF change silently locked out Google’s crawlers, the error count climbed past 100,000 URLs, and even after the firewall was fixed, a structurally messy robots.txt kept the site from recovering. This is the full post-mortem, day by day: what broke, how we traced it through Cloudflare Events and Search Console, and the numbers before and after.

If you run a site behind Cloudflare, this case is worth ten theory articles. It shows exactly where the standard checks fail and gives you the monitoring routine we now apply to every SEO program we manage for sites behind a CDN or firewall.

Day 1: crawling falls off a cliff

The incident had a precise start date. On day one, a set of anti-bot and geo rules was changed in Cloudflare’s WAF. From that day, the Crawl Stats report in Search Console shows a sharp drop: Googlebot’s crawling collapsed to roughly 100 pages a day on a catalog of tens of thousands of URLs. Google’s snippet for the homepage turned into “no information is available for this page,” the homepage got a “blocked by robots.txt” status in Search Console, and the number of URLs with that error grew past 100,000.

Here is the part that makes this case instructive: the robots.txt file itself contained no rule blocking the homepage, products, categories, brands, or pagination. Every check we could run said the file was fine:

  • Search Console’s robots.txt report showed the file fetched successfully, zero errors.
  • Third-party robots.txt testers all confirmed the homepage was not blocked.
  • The file opened normally in a browser.

When every validator disagrees with Googlebot, believe Googlebot. The tools parse your file; only Google knows what its crawler actually received. And when Google cannot fetch robots.txt at all – because a firewall serves a challenge or an error instead of the file – it plays it safe: per Google’s documentation, it first stops crawling the site, and if the file stays unreachable while the site looks unavailable, it halts crawling entirely. To Search Console, that condition reports as “blocked by robots.txt” even though the file’s content is innocent.

Crawl Stats told the whole story: a healthy 20-45k requests a day, a cliff on day one, and a flat line near zero for the next month.

Sources and further reading

The primary documentation this article is based on:

  1. Google Search Central – How Google interprets the robots.txt specification (official documentation).
  2. Google Search Central – Robots.txt report in Search Console (help documentation).
  3. Google Search Central – Crawl Stats report (help documentation).
  4. Google Search Central – Overview of Google crawlers and user agents (official documentation).
  5. Cloudflare Docs – Verified bots (bot solutions documentation).
  6. Cloudflare Docs – Allow traffic from verified bots (WAF custom rules documentation).

Day 30: the investigation – suspect everything that filters traffic

Why did a month pass before the alarm went off? Three reasons, and they are worth naming because they will apply to your site too. Search Console reports indexing errors with a delay, and during a Google update rollout that lag stretched to weeks. Our error review ran on its monthly cycle, so the ballooning “blocked by robots.txt” count surfaced at the start of the next month. And the one report that showed the problem in near real time – Crawl Stats – was not part of anyone’s routine, because nothing on the site had “changed.” That last gap became a standing rule for us: any significant infrastructure change now triggers a scheduled before-and-after check of crawl statistics, and this incident is why.

We started from the hypothesis that some Cloudflare mechanism was intercepting Google: WAF custom rules, Bot Fight Mode, rate limiting, or geo rules. The first practical obstacle was access – the initial Cloudflare account we were given could not see Security Events or the WAF. If you take one operational lesson from this section, take this one: to debug a crawling incident you need zone-level access to Security Events, WAF, Bots, rate limiting, and cache rules. We requested it, got administrator rights on the zone, and went straight to the block logs.

The real culprit: Google is not one bot

The firewall already had an SEO allow rule – but it matched user agents containing the strings “Googlebot” and “bingbot” and nothing else. The problem: Google crawls and checks your site with a whole family of agents. The live URL test in Search Console, for example, runs as Google-InspectionTool. That name does not contain “Googlebot,” so every live test fell through the allow rule into the challenge rules below it – which is exactly why regular crawling partially worked while URL Inspection kept stamping the homepage “blocked by robots.txt.”

Google Search Console URL Inspection live test showing URL is not available to Google, crawled as Google Inspection Tool smartphone, page fetch failed: blocked by robots.txt
The live test that would not turn green. Note the “Crawled as” line: Google Inspection Tool smartphone – not Googlebot.
Cloudflare custom rule allowing crawlers by matching user agent strings Googlebot and bingbot with Skip action for WAF components
The original allow rule: a Skip action gated on the user agent containing “Googlebot” or “bingbot.” Everything Google sends under any other name fell through to the challenge rules.

Cloudflare Events confirmed it in one screen: in a single 24-hour window, 16 block events and 12 challenge events against genuine Google agents, including requests for robots.txt itself. The fix went in two steps. First, the tactical one: extend the exceptions to the agents Google and other engines actually use – Google-InspectionTool, GoogleOther, Storebot-Google, AdsBot-Google, BingPreview – across every rule that could catch them, not just the one allow rule. Then the durable one: replace the hand-maintained user-agent list entirely with Cloudflare’s own bot classification:

cf.verified_bot_category eq "Search Engine Crawler"

This condition matches every crawler Cloudflare has cryptographically verified as a search engine agent – by published IP ranges and reverse DNS, not by the name in the request header. It covers agents you forgot about and agents that do not exist yet, and it does not match impostors. Alongside it we updated a pagination-filtering rule that was still catching Google-InspectionTool, added a dedicated cache rule for /robots.txt, purged the file from the edge cache, and moved AI-crawler management into Cloudflare’s AI Crawl Control instead of hand-written rules.

Days 31-32: the firewall is clean, but Google still says blocked

The next 24 hours of Cloudflare Events looked the way they should: 231 successful robots.txt fetches by Googlebot – roughly ten per hour – zero blocks and zero challenges for genuine Google agents, AdsBot passing cleanly, and Googlebot slowly ramping up with 548 page requests. Bingbot, which had also been partially caught, ran 47,700 successful requests over the week.

Two categories of blocked traffic remained, and both were correct: internal platform endpoints that are intentionally closed, and 25 requests claiming to be Googlebot from cloud servers in Taiwan – fake crawlers that Cloudflare’s verification rightly challenged. That is the second lesson of this case: never trust the user-agent string alone. An allow rule for anything that calls itself Googlebot is an open door for scrapers; verified-bot classification lets the real one in and keeps the impostors out.

But Search Console kept showing “blocked by robots.txt,” and daily crawling stayed far below normal. Part of that is expected – GSC statuses lag days behind reality, which is why you verify a fix in Cloudflare Events and server logs, not by refreshing Search Console. But as the days passed, the crawl rate was not recovering the way a pure reporting lag would predict. Something else was still wrong.

Day 37: the second cause – a “valid” robots.txt with two user-agent groups

One of our remaining hypotheses was to force Google to reload and re-evaluate robots.txt – not just request a recrawl, but actually change the file, because a changed file is guaranteed to be reparsed as new. While preparing that change we took a hard look at the file’s structure.

The site’s e-commerce platform auto-generates the top of robots.txt: a User-agent: * line and the sitemap reference, followed by a marked custom section. Our custom rules had been added with their own second User-agent: * declaration. So the file effectively contained two wildcard groups – one holding only the sitemap, one holding all the actual rules. Here is the structure, simplified:

User-agent: *
Sitemap: https://domain.com/sitemap.xml

User-agent: *
Content-Signal: search=yes,ai-train=no,use=reference
Allow: /web/assets/
Allow: /web/image/
Disallow: /web/
Disallow: /shop/cart
Disallow: /shop/checkout
Disallow: /my
Disallow: /website/info

Two User-agent: * lines, one file. Every robots.txt checker accepted it, and Google’s spec even says duplicate groups get merged. But how a crawler picks its rules is more subtle than most tools model:

Google’s crawlers determine the correct group of rules by finding in the robots.txt file the group with the most specific user agent that matches the crawler’s user agent. Other groups are ignored.

Author Google Search Central, How Google interprets the robots.txt specification
-

We collapsed the file into a single group – one User-agent: * line, all rules directly under it, sitemap at the end:

User-agent: *
Allow: /web/assets/
Allow: /web/image/
Disallow: /web/
Disallow: /shop/cart
Disallow: /shop/checkout
Disallow: /my
Disallow: /website/info
Sitemap: https://domain.com/sitemap.xml

In practice: we removed the extra User-agent: * from the custom section so all rules attach to the auto-generated top block, kept AI crawlers in their own separate sections, purged the file’s edge cache again, and asked Google for a fresh fetch. For the record: the platform’s # custom # comment block was never the problem – comments and unknown lines are ignored by the parser. The duplicate wildcard group was.

Day 38: recovery, in numbers

The response was immediate and unambiguous. The day after the robots.txt change, Crawl Stats registered 31,263 requests in a single day – against near zero for the preceding month:

Google Search Console Crawl Stats chart showing crawl requests spiking back to over 31,000 per day after the robots.txt fix
The recovery spike: 31,263 crawl requests and 2.78 GB downloaded in one day, right after the robots.txt restructure.

Comparing Cloudflare data for Googlebot only:

Googlebot metric During the incident After the fix
Requests per day ~1,000 ~32,000
Blocked or challenged ~14% ~0.4%
Requests reaching the site ~300 Nearly all
Overall change ~30x growth, sustained

The elevated crawl rate held for more than a day, so this was a regime change, not a spike. Googlebot went back to crawling products and categories and getting 200 OK responses. The remaining ~125 blocked requests per day were all to internal technical endpoints that are closed on purpose. In Search Console, the “blocked by robots.txt” count first rose as Google reprocessed the backlog, then began its steady decline – on a large site, expect the index to take weeks to fully catch up after crawling recovers.

What the tools said vs. what actually happened

Check What it reported What was actually true
Robots.txt validators File valid, homepage not blocked Parsers tolerated the double user-agent group; Google’s parser did not apply it the same way
GSC robots.txt report Fetched OK, no errors Fetch status says nothing about firewall behavior on other Google agents or how rules are grouped
Browser check of the site Site loads fine Cloudflare treats a browser and a crawler differently; humans saw the site, several Google agents did not
GSC live URL test Blocked by robots.txt Correct – and it runs as Google-InspectionTool, which is exactly the agent the firewall was challenging
Crawl Stats report Collapse to ~100 pages/day from day one The clearest quantitative signal, and the one that dated the incident to the WAF change

The playbook: how to run Cloudflare without losing Google

These are the standing rules we took out of this incident. They apply the day you put any site behind Cloudflare, and again any time you touch its security rules.

  1. Date-match the incident to your firewall history. Pull the Crawl Stats report, find the day crawling changed, and compare it against every WAF, bot, geo, and rate-limiting change made around that date. Our collapse dated precisely to a rules change.
  2. Audit what Cloudflare actually blocks. Pull Security Events for the last 24 hours and 7 days and, for each event, look at the path, user agent, verified-bot status, action taken, matched rule, and HTTP status. This is tedious by hand and a perfect job for an AI assistant with browser access – have it extract the full blocked-traffic statistics and summarize which bots and URL patterns are affected, including Ajax and API endpoints your pages need for rendering.
  3. Check all of Google’s agents, not just Googlebot. Google-InspectionTool, GoogleOther, Storebot-Google, and AdsBot-Google identify themselves differently, and a string match on “Googlebot” misses every one of them.
  4. Allow the verified category, not bot names. Use cf.verified_bot_category eq "Search Engine Crawler" (or the Known Bots field, cf.client.bot) instead of a hand-maintained user-agent list – and keep challenging unverified traffic that merely claims to be Googlebot, because some of it will be fake.
  5. Give robots.txt special treatment. Confirm it is reachable in Search Console’s robots.txt report, add a dedicated cache rule for it, and purge that cache every time the file changes – otherwise Google may keep receiving the stale edge copy of the file you just fixed.
  6. Keep robots.txt to a single group per agent. One User-agent: * block, all rules under it, sitemap reference intact. If your platform auto-generates part of the file (as many e-commerce systems do), attach your custom rules to that block instead of declaring a second one.
  7. Verify the fix in logs, not in GSC. Cloudflare Events, server logs, 200 OK responses, and the crawl rate are your real-time truth; Search Console statuses can lag for days. Baseline crawl stats before a Cloudflare change and compare a week after.

How to tell the fix worked

Recovery has a clear signature, in this order: robots.txt fetches succeed steadily in Cloudflare Events; block and challenge counts for verified search agents drop to zero; the daily crawl rate jumps within 24-72 hours (ours grew roughly 30x); the “blocked by robots.txt” count in page indexing first rises as Google reprocesses the backlog, then declines week over week; snippets return to normal. Crawling always recovers first – the index and rankings follow gradually.

The reverse also matters. If two weeks after a Cloudflare change your crawl stats have not recovered, something is still filtered – go back to the block logs. A site that Google cannot reliably fetch cannot rank, no matter how good the site build or content is. And partial blocking hurts quietly too: at one point Cloudflare was blocking an Ajax endpoint that renders a “similar products” block, so visitors saw it while Google’s renderer could not fetch it – the kind of gap we hunt in system integration and tracking audits.

Behind a CDN and not sure what Google sees?

We audit exactly this: firewall rules, crawl budgets, robots.txt parsing, and rendering gaps on sites behind Cloudflare and other CDNs. If your indexing dropped and the usual checkers say everything is fine, our SEO team can find what Googlebot is really hitting – request a free technical crawl audit and we will start with your block logs, not with guesses.

FAQ: blocked by robots.txt and Cloudflare

What does "blocked by robots.txt" mean in Google Search Console? +
It means Googlebot believes a robots.txt rule forbids crawling that URL. It can be a real disallow rule, but it can also appear when Google cannot fetch your robots.txt at all - for example, when a firewall challenges the request - or when Google parses a structurally messy file differently than validators do.
Can Cloudflare block Googlebot even if my robots.txt is correct? +
Yes. Misconfigured WAF, bot-fight, geo, or rate-limiting rules can challenge or block Google's crawlers regardless of what robots.txt says. If the blocked request is for robots.txt itself, Google treats the whole site as uncrawlable, so the error shows up as "blocked by robots.txt."
What is Google-InspectionTool and why does it matter? +
It is the user agent that runs the live URL test in Search Console. Its name does not contain "Googlebot," so firewall allow rules that match the string "Googlebot" miss it - which produces the confusing state where the site partially crawls but every live test reports it as blocked.
What happens if Google cannot access robots.txt? +
Google treats an unreachable robots.txt as a stop sign. Per Google's documentation, when robots.txt returns server errors Google first stops crawling the site, then falls back to a cached copy, and if the site looks unavailable it halts crawling entirely.
Why do robots.txt testers say my file is fine but Google says it is blocked? +
Validators check syntax; they do not replicate Google's exact group-selection logic or Google's actual fetch through your firewall. Verify with the URL Inspection live test and your Cloudflare or server logs - those show what Google's agents really experience.
Can I have two User-agent: * groups in robots.txt? +
Avoid it. The spec says duplicate groups get merged, but in this case a file with two wildcard groups kept a large site blocked even though every checker passed it. One group per agent, with all rules inside it, is the only structure that behaves predictably.
Should I allow every request with a Googlebot user agent? +
No. Anyone can send the Googlebot string - in this case, 25 fake "Googlebots" were crawling from Taiwanese cloud servers. Use Cloudflare's verified-bot classification to allow the real search engine crawlers and keep challenging the impostors.
Share - - - -
-

Not sure what Googlebot sees behind your Cloudflare?

If indexing dropped and every checker says your site is fine, the problem is usually in the firewall logs. Leave your URL and we will run a free technical crawl audit: Cloudflare rules, robots.txt parsing, and crawl stats.

Service Form First SEO
Checkboxes