robots.txt "Disallow: /" shipped to production: what happens and what to do
A staging robots.txt usually looks like this:
User-agent: * Disallow: /
On production it tells every compliant crawler to fetch nothing. Google can still show already-known URLs for a while, without a description, but it stops crawling, so changes and new pages go unseen. Over time, rankings and traffic slide.
Fix it
- Deploy the production robots.txt, or remove the blanket
Disallow: /. - In Search Console, check the robots.txt report so Google picks up the new file sooner.
- Request indexing for the key URLs and resubmit the sitemap.
Stop it happening again
- Generate robots.txt per environment at build time instead of committing one file.
- Protect staging with HTTP authentication rather than robots.txt. robots.txt doesn't keep pages private anyway.
- Check after every deploy. The free checker applies Google's matching rules (user-agent groups, longest match,
*and$) to your real URLs, and also flags a robots.txt that returns 5xx.
No command line handy? Check one URL with the online indexability checker.