In this article
Before crawling a site, a search bot requests robots.txt. If the file simply doesn’t exist (a 404 error), the bot assumes there are no restrictions and carries on. But if the server answers that request with a 5xx error or doesn’t answer at all, the bot doesn’t know what it is allowed to do, and slows down or stops crawling just in case.
What it is
| Response for robots.txt | What Google does |
|---|---|
| 200 | Reads the rules and follows them |
| 404 / 410 | Assumes there are no restrictions and crawls the whole site |
| 5xx or no response | Temporarily stops crawling; if the error persists, uses the last saved version of the file or treats the site as unavailable |
A 5xx error on robots.txt almost always means the request is handled by the CMS rather than the web server: the file doesn’t physically exist and PHP generates it. If PHP or the database goes down, robots.txt goes down with the site.
How the monitor checks
Impact on the site and business
- New pages and changes don’t reach search until the bots resume crawling.
- If the problem lasts, pages may start dropping out of results.
- A sign of server trouble: if robots.txt fails, the site itself usually goes down from time to time too.
Why it matters
The owner sees that the site opens and has no idea that Google’s bot gets an error on a utility file on every visit. It is especially sneaky when protection (a firewall, Cloudflare) answers bots with a 503 on robots.txt while showing people the site normally.
Norms
| Rating | Response | Comment |
|---|---|---|
| Good | 200 with the rules text | Bots know what is allowed |
| Could be better | 404 | No restrictions; better to create a file with a sitemap link |
| Bad | 5xx, timeout or connection error | Bots stop crawling |
How to fix it
- Open
your-site/robots.txtin a browser and see what comes back. - If it is an error, check whether the file physically exists in the site root.
- Create a static
robots.txtfile in the root: the web server serves it by itself, without PHP or the database, and it works even when the site is down. - If the site is behind protection, check that robots.txt isn’t caught by “Just a moment” challenges and bot blocking.
WordPress
By default WordPress generates robots.txt with PHP. Create a real file in the site root (next to wp-config.php) — it replaces the virtual one. Copy into it the content the site is currently serving.
Server (nginx)
Make sure the robots.txt request is served as a file rather than passed to PHP, and isn’t logged needlessly:
location = /robots.txt {
try_files $uri =404;
access_log off;
}Cloudflare
If “Under Attack” mode, Bot Fight Mode or browser check rules are on, bots may get an error on robots.txt. Add a rule that lets /robots.txt through without checks, or use “Verified bots” in your WAF rules.
General recommendations
- Keep robots.txt as a static file — that is the most reliable option.
- Check the “Crawl stats” report in Google Search Console: it shows errors when fetching robots.txt.
- If the monitor shows a robots.txt error together with site outages, fix the site first.
FAQ
Which is better: no robots.txt or an empty one?
For bots it is the same — no restrictions. But it is better to have a file with at least a sitemap link.
robots.txt fails only occasionally. Is that a problem?
Isolated failures are harmless. If they repeat every day, Google noticeably reduces how often it crawls.
Why does the site open for people while robots.txt gives bots a 503?
Most likely bot protection is blocking it. Set up an exception for robots.txt and for verified search bots.