Skip to content
FunnelGuard

Fix guide by FunnelsGuard

robots.txt returns 5xx: why Google stops crawling and how to fix

SEO-004High impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

Before crawling your site, Googlebot requests https://yourdomain.com/robots.txt to read your crawl rules. The server answers with an HTTP status code. A 5xx code means the server failed, not that the file is missing.

A 404 tells Google there are no rules, so it crawls everything. A 5xx tells Google it does not know the rules. Google's documented behaviour is cautious: it stops crawling the site for a while, retries, and if the errors continue for a long time it may fall back to the last good copy of the file it has stored. If there is no usable copy, crawling can stay stalled.

What happens when robots.txt fails
  1. Googlebot requests robots.txtRoutine check before crawling
  2. Server returns 5xx500, 502, 503 or 504
  3. Crawling pausedGoogle cannot confirm what is allowed
  4. New and updated pages not picked upSlower indexing and refreshes

The error at the first step holds back everything after it.

Why it costs you leads or sales

If Google pauses crawling, new landing pages, price changes, stock updates and fixed content are not seen. Pages can drop out of results or show stale snippets. Organic traffic, which often brings your cheapest leads, shrinks quietly. AI search tools that rely on search indexes may also see less of your site.

The damage grows the longer the error lasts. A few minutes of 503 during a deploy is usually harmless. Hours or days of errors are not.

Pages crawled per day while robots.txt errorsExample numbers
Pages crawled per day while robots.txt errors (example)Day 1 (healthy): 5,000 pages; Day 2 (errors begin): 1,800 pages; Day 3: 300 pages; Day 4 (fixed): 900 pages; Day 6: 3,800 pages01,9173,8335,0001,8003009003,800Day 1 (healthy)Day 2 (errors begin)Day 3Day 4 (fixed)Day 6pages

Example: illustrative numbers showing crawling falling after robots.txt starts returning 5xx, then recovering after the fix.

How to check if your site has it

Check the robots.txt status code
  1. Request the file with curl

    Run the command below. You want HTTP/2 200 and a content-type of text/plain.

  2. Test the other hostnames

    Repeat for http, https, www and non-www. One variant can fail while another works.

  3. Check Search ConsoleGoogle Search Console

    In Google Search Console open Settings, then Crawl stats, then the robots.txt fetch details (the Hosts and robots.txt section). Look for fetch status 'Not fetched: server error (5xx)'.

  4. Check your server logs

    Search access logs for requests to /robots.txt from Googlebot and look at the status codes returned. Intermittent 5xx errors show up here even when your own tests pass.

Check status code and headersbash
curl -sI https://example.com/robots.txt

# Check as a Googlebot user agent string (may behave differently behind a WAF)
curl -sI -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://example.com/robots.txt

How to fix it

The cause is usually one of a few things: an application error on a dynamic robots.txt, a server or proxy misconfiguration, an overloaded origin, a broken CDN or firewall rule, or a maintenance mode that returns 503 for every URL including robots.txt.

Common causes by status code
StatusTypical causeFirst thing to check
500Script or plugin error generating robots.txtApplication error log
502Proxy or CDN cannot reach the originOrigin health and proxy config
503Maintenance mode or overloadMaintenance plugin, server load
504Origin too slow, gateway timeoutSlow queries, PHP timeouts
Fix by platform
  1. Disable robots.txt-related plugins

    SEO plugins (Yoast, Rank Math, All in One SEO) serve a virtual robots.txt through PHP. Deactivate them one at a time and re-test to find a plugin throwing an error.

  2. Turn off maintenance mode

    Some maintenance or coming-soon plugins return 503 for all URLs. Exclude /robots.txt or disable the mode on live sites.

  3. Read the PHP error log

    Enable WP_DEBUG_LOG in wp-config.php or check your host's error log for fatal errors at the time of the failing request.

nginx: always serve robots.txt, even in maintenance modenginx
location = /robots.txt {
    root /var/www/example.com/public;
    default_type text/plain;
    access_log off;
}

# Put this block before any rule that returns 503 for maintenance.

How to confirm it's fixed

Confirm recovery
  1. Re-run curl several times

    Check the status is 200 on every hostname, repeatedly over a few hours, to rule out intermittent errors.

  2. Open the robots.txt reportGoogle Search Console

    In Search Console, go to Settings, then the robots.txt report. Check the latest fetch shows as fetched. You can request a recrawl there for the file.

  3. Watch Crawl statsGoogle Search Console

    Over the next days, the total crawl requests and the robots.txt fetch failures should recover.

robots.txt before and after the fix

Broken

  • /robots.txt returns 503 or 500
  • Search Console reports a server error
  • Crawling is slowed or paused

Fixed

  • /robots.txt returns 200 as text/plain
  • Search Console shows a successful fetch
  • Crawling returns to normal

How to prevent it happening again

Prevention checklist
  • Serve robots.txt as a static file where you can
  • Exclude /robots.txt from maintenance mode and firewall rules
  • Cache robots.txt at the CDN so origin outages do not break it
  • Test robots.txt after every deploy, plugin update and server change
  • Set up uptime monitoring on the exact /robots.txt URL, not just the homepage
  • Review the Search Console robots.txt report and Crawl stats regularly

How FunnelGuard handles this

FunnelGuard does not check robots.txt status codes today. It is a possible future check, but it is not available now.

What FunnelGuard does cover nearby is your funnel itself: a robot visitor runs your real customer journeys (lead forms, checkouts, booking and chat buttons) on a schedule, checks each step and the tracking hits sent to ad and analytics platforms, and verifies test leads reach your inbox and CRM. That helps you spot broken conversion paths, but it will not tell you Google cannot fetch robots.txt.

To watch for this yourself, use a general uptime monitor pointed at /robots.txt that alerts on any non-200 status, check the Search Console robots.txt report and Crawl stats, and scan your server logs for Googlebot requests that got 5xx responses. FunnelGuard also offers a free read-only website audit if you want a broader look at your site.

Questions people ask

Why is Google not crawling my site after a robots.txt error?

If robots.txt returns a 5xx error, Google cannot confirm what it may crawl, so it slows or pauses crawling the whole site. It retries and resumes once the file returns a normal response. Fix the server error and check the Search Console robots.txt report.

What happens if robots.txt returns a 500 error?

A 500 means the server failed when serving the file. Google treats it as a temporary problem and holds back crawling. If it keeps failing for a long time, Google may use an older stored copy of your rules or keep crawling stalled.

Is a 503 on robots.txt okay during maintenance?

Only for a very short time. A brief 503 during a deploy is normally tolerated, but a long one can stall crawling of every page. Keep /robots.txt returning 200 even when the rest of the site is in maintenance mode.

Is it better for robots.txt to return 404 or 5xx?

A 404 is safer than a 5xx. A 404 tells Google there are no restrictions, so crawling continues. A 5xx tells Google the rules are unknown, so it stops. The best option is a valid file that returns 200.

How do I check my robots.txt status code?

Run curl -sI https://yourdomain.com/robots.txt and read the first line for the status. You want 200. Also check the robots.txt report in Google Search Console and your server logs for intermittent failures.

How long does Google take to recover after I fix robots.txt?

Google re-fetches robots.txt often, so recovery can begin within hours of a fix. Crawling usually returns to normal over the following days. You can request a recrawl of the file in the Search Console robots.txt report.

Does FunnelGuard monitor robots.txt for server errors?

No. FunnelGuard does not check robots.txt today; it is a possible future check. Use an uptime monitor on /robots.txt and the Search Console robots.txt report in the meantime.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.