Robots.txt Mistakes That Can Deindex Your Entire Site
The robots.txt file is a few lines of plain text, which makes it deceptively dangerous. A single misplaced directive can hide your entire site from search — and the damage compounds silently until traffic falls off a cliff. Let's cover the mistakes that cause real harm and how to prevent them.
What robots.txt actually controls
Robots.txt lives at your root (/robots.txt) and tells compliant crawlers which URLs they may request. Critically, it controls crawling, not indexing. This distinction is the source of most disasters.
Mistake 1: Blocking the whole site in production
The single most catastrophic line:
User-agent: *
Disallow: /
This tells every crawler to request nothing. It's standard on staging environments — and it ships to production far too often when a site goes live and nobody swaps the file. Always verify robots.txt on launch day. If organic traffic drops sharply within a week or two of a release, check this first.
Mistake 2: Assuming Disallow removes pages from the index
Here's the counterintuitive part. If you Disallow a URL that's already indexed, the crawler can no longer read the page — including any noindex tag on it. So the URL can stay in the index, often shown as "Indexed, though blocked by robots.txt."
To remove a page from search, you must let it be crawled and add a noindex meta tag (or an X-Robots-Tag HTTP header). Blocking in robots.txt does the opposite of what people expect.
Mistake 3: Blocking CSS and JavaScript
Modern search engines render pages to see what users see. If you block your /assets/ or /js/ directories, the crawler renders a broken page and may misjudge your content and mobile-friendliness. Never block resources needed to render the page.
Mistake 4: Case-sensitivity and path errors
Paths in robots.txt are case-sensitive and matched as prefixes. Disallow: /Admin won't block /admin. And Disallow: /news blocks /news, /news-2026, and /newsletter — anything starting with that string. Use a trailing slash (/news/) when you mean a directory.
Mistake 5: Forgetting the sitemap directive
Add your sitemap location so crawlers discover it:
Sitemap: https://example.com/sitemap.xml
It's not required, but it's free discovery help.
Mistake 6: Using robots.txt for security
Robots.txt is public. Listing Disallow: /secret-admin/ advertises exactly where your sensitive paths are to anyone who reads the file. Never rely on it to hide anything — use authentication instead.
Build it correctly
Rather than hand-editing and hoping, generate a validated file with our Robots.txt Generator at /tools/robots-generator. It produces correct syntax, lets you set per-bot rules, and includes the sitemap directive. For the AI-crawler era, pair it with the Crawler Governance tool at /tools/crawler-governance, which helps you decide and enforce policy for bots like GPTBot, ClaudeBot, and others — separate from your search-engine rules.
A safe deployment checklist
Before every release that touches robots.txt:
- Diff the file against production. Know exactly what changed.
- Confirm no blanket
Disallow: /unless the site should be hidden. - Verify CSS/JS directories aren't blocked.
- Test with the robots.txt Tester in Search Console (
/search-console) against real URLs. - Check the file after deploy by loading
yoursite.com/robots.txtin a browser.
Monitor for silent changes
Robots.txt gets edited by developers, CMS plugins, and CDN config — often without the SEO team knowing. Set up monitoring so you're alerted when the file changes. A Full Site Audit at /full-site-audit flags robots.txt problems and pages blocked from crawling, and Search Console will warn you about "blocked by robots.txt" URLs in the Pages report.
The bottom line
Robots.txt is a scalpel, not a hammer. It controls crawling of URLs you don't want crawled — parameter junk, internal search, admin areas — while letting your valuable pages through. Get the crawl-versus-index distinction right, avoid blocking render resources, and verify the file on every deploy. Treat those few lines with the respect they deserve and they'll never cost you a ranking.
Devin Okafor
Technical SEO Lead
Writing about SEO and AI-search strategy for the SEO Roger blog.