On this page
What this issue is
robots.txt is a small text file at the root of your site (for example https://example.com/robots.txt). It tells search engine crawlers which URLs they may visit. Crawlers request it before they crawl anything else.
A 5xx status code means the server failed to answer properly. Common ones are 500 (internal error), 502 (bad gateway), 503 (service unavailable) and 504 (timeout). If robots.txt returns one of these, the crawler cannot tell what it is allowed to visit.
Google's documented behaviour is cautious. While robots.txt returns a server error, Google stops crawling the site. If the error lasts for a long time, it may fall back to the last good copy of the file, and after that it may act as if no restrictions exist. A missing file (404) is treated differently: it means everything may be crawled.
| Response | What it means to a crawler | Risk |
|---|---|---|
| 200 with valid rules | Follow the rules | None |
| 404 / 410 | No rules, crawl everything | Low |
| 5xx or timeout | Cannot tell, crawling is paused or limited | High |
| Redirect loop | Treated as an error | High |
Why it costs you leads or sales
Search engines send visitors to your landing pages, product pages and forms. If crawling stops, new pages are not discovered, changed prices and stock are not refreshed, and pages can slowly drop out of results. Organic leads and sales fall, and the cause is easy to miss because the site itself looks fine to people.
- Crawler requests robots.txtFirst request on every crawl
- Server returns 5xxPlugin, proxy or server fault
- Crawling pausedNew and changed pages not fetched
- Rankings and traffic slipFewer organic leads and sales
The site works for visitors, but crawlers are stopped at the first request.
How to check if your site has it
Open the file in a browser
Visit https://yourdomain.com/robots.txt. You should see plain text rules, not an error page.
Read the real status code
A browser can hide the code. Run the curl command below, or use your browser's developer tools (Network tab).
Check both www and non-www, and http and https
Each version can behave differently, especially after a migration or CDN change.
Look in Google Search Console
Open Settings, then Crawl stats, then the robots.txt section (also shown as Hosts). It lists fetch status for recent days. The Page indexing report may also show pages blocked or not fetched.
Check your server logs
Search the access and error logs for requests to /robots.txt that returned 5xx, and note the times.
curl -I https://yourdomain.com/robots.txt
# Pretend to be Googlebot (for testing your own site only)
curl -I -A "Googlebot" https://yourdomain.com/robots.txtHow to fix it
The aim is simple: /robots.txt should always return 200 with valid rules, or a clean 404 if you do not want one. The cause depends on your setup, so work through the common ones.
Find the failing layer
Compare the response from your origin server with the one through your CDN or proxy. If only the CDN returns 5xx, the fault is in the CDN or its link to the origin.
Check the error log
A 500 usually leaves a PHP or server error. A 502 or 504 points to a crashed or overloaded backend, such as PHP-FPM or an upstream app.
Disable recent changes
Switch off the SEO plugin, security plugin, caching rule or rewrite rule you changed last, then retest.
Serve a real file
Upload a static robots.txt to the web root so no application code is needed to answer the request.
Clear caches
Purge the CDN, server and plugin caches so an old error response is not still being served.
Retest and request a recrawl
Confirm 200 with curl, then use the robots.txt report in Search Console to request a recrawl of the file.
Test with a physical file
WordPress creates a virtual robots.txt when no file exists. Upload a real robots.txt to the site root via SFTP or your host's file manager to bypass PHP.
Check SEO and security plugins
Yoast, Rank Math, All in One SEO and security plugins can edit robots.txt. Deactivate them one at a time and retest.
Check .htaccess
Rename .htaccess temporarily. If robots.txt works, regenerate it under Settings, then Permalinks, then Save.
Raise PHP limits if needed
If logs show memory or timeout errors, ask your host to raise memory_limit or check PHP-FPM workers.
Check the template
Shopify serves robots.txt from the robots.txt.liquid template. Open Online Store, then Themes, then Edit code, and look for a Liquid error in templates/robots.txt.liquid.
Restore the default
If the template is broken, delete it to return to Shopify's default file, or paste back a known good version.
Check Shopify status
If the template is untouched, check Shopify's status page and contact support, since the platform controls the server.
Check the SEO settings
Open Site settings, then SEO, and review the robots.txt box. Save valid rules, or clear it and republish.
Republish the site
Publish again to all domains, then retest. If the error remains, check Webflow's status page and contact support.
Review the editor
Wix generates robots.txt. In the dashboard, go to Marketing and SEO, then SEO Tools, then Robots.txt Editor, and reset any custom edit.
Contact Wix support
If the default file still errors, the fault is on the platform side, so report it with the curl output.
Check for custom code
Squarespace generates robots.txt and does not let you replace it. Remove recent code injection or URL mappings that touch /robots.txt.
Contact support
If it still returns 5xx, the fault is on the platform side. Send support the curl output and the time.
Serve it as a static file
Put robots.txt in the document root and make sure the web server serves it before any app routing.
Exclude it from app rewrites
If a front controller handles all requests, allow existing files through. See the nginx example below.
Check the upstream
For 502 or 504, check that PHP-FPM, Node or your app server is running and has enough workers.
location = /robots.txt {
root /var/www/example.com/public;
try_files $uri =404;
access_log off;
}User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://yourdomain.com/sitemap.xmlHow to confirm it's fixed
- curl -I returns 200 (or a deliberate 404) for /robots.txt
- The same result on www, non-www, http and https
- The same result with a Googlebot-style user agent
- The response is not served from a stale CDN cache
- Search Console robots.txt report shows a successful fetch
- Crawl stats show no new robots.txt server errors over the next few days
- The file does not contain an accidental 'Disallow: /'
Google re-fetches robots.txt often, but it caches the result for up to about a day. Recovery of normal crawling can take a few days, so keep checking Crawl stats.
How to prevent it happening again
Day 1, 02:00
A plugin update breaks the code that generates robots.txt, which now returns 500.
Day 1, 09:00
The site looks fine to staff, so nobody notices.
Day 3
Search Console starts reporting robots.txt fetch failures and crawling slows.
Day 6
Someone spots it, serves a static file and requests a recrawl.
- Serve robots.txt as a static file where you can
- Monitor /robots.txt with an uptime tool that alerts on any non-200 status
- Turn on Search Console email alerts and review Crawl stats monthly
- Test robots.txt after plugin, theme, CDN and hosting changes
- Keep a copy of your known good file in version control or a backup
- Make sure firewall and rate limit rules do not block crawlers
- Size your server so PHP workers do not run out under crawl load
How FunnelGuard handles this
FunnelGuard does not check robots.txt today. It is a possible future check, not a current feature.
What FunnelGuard does do is run your real customer journeys (lead forms, checkouts, booking and chat buttons) on a schedule from the EU or the US, check each step and the tracking hits sent to ad and analytics platforms, and re-check a failure from a second region before sending one alert. If a server problem is also breaking a page or form your visitors use, that journey check can show it. It will not tell you that crawlers are being refused.
To watch for this issue now, use Search Console (Crawl stats and the robots.txt report), add an uptime monitor on your robots.txt URL that alerts on any non-200 response, and review your server logs. You can also start with the free FunnelGuard plan (1 site, 2 journeys, daily checks, no card) to cover your key journeys while you do that.
Questions people ask
What happens if robots.txt returns a 500 error?
Google treats a 5xx robots.txt as a sign it cannot tell what it may crawl, so it pauses or limits crawling of the site. If the error lasts a long time, it may use an older cached copy or eventually assume there are no restrictions. Fix it quickly to avoid slower discovery of new pages.
Why is Google Search Console saying robots.txt is unreachable?
It means Google tried to fetch the file and got a server error, a timeout or a blocked connection. Check the status with curl, review your server and error logs, and test with a Googlebot-style user agent, since firewalls sometimes block bots only.
Is it better for robots.txt to return 404 than 5xx?
Yes. A 404 tells crawlers there are no rules, so they crawl normally. A 5xx tells them something is wrong, which can stop crawling. Ideally you serve a valid 200 file with a sitemap line.
How do I check my robots.txt status code?
Run curl -I https://yourdomain.com/robots.txt in a terminal, or open your browser's developer tools and look at the Network tab. You want to see 200. Also test www, non-www, http and https versions.
How long does it take Google to recover after I fix robots.txt?
Google caches robots.txt for up to about a day, so it may take that long to notice the fix. You can request a recrawl of the file in Search Console. Normal crawling usually returns over the following days.
Why does my robots.txt work for me but fail for Googlebot?
A firewall, CDN, security plugin or rate limit may block or error on bot traffic only. Test with a Googlebot-style user agent and check your firewall logs. Do not disable security fully; adjust the rule that catches crawlers.
Can a WordPress plugin cause a robots.txt 5xx error?
Yes. WordPress builds a virtual robots.txt in PHP, and SEO or security plugins can edit it. A plugin fault can return a 500. Uploading a real robots.txt file to the site root removes PHP from the request.
Does FunnelGuard monitor robots.txt?
Not yet. It is a possible future check. FunnelGuard monitors your customer journeys, tracking and lead delivery, so use Search Console and an uptime monitor for robots.txt for now.
Related issues
- OPS-092Hosting migration left old server serving some trafficFix guide
- OPS-094Rate limiting on host blocks normal visitorsFix guide
- OPS-090One bad node behind load balancer (random failures)Fix guide
- OPS-073Memory / PHP memory_limit exhausted (white screen)Fix guide
- OPS-074CPU throttling / entry process limits on shared hostingFix guide
- OPS-091Auto-scaling failure during traffic peakFix guide