SEO glossary
What is Robots.txt?
Learn what robots.txt is—how crawlers interpret allow and disallow rules, common misconfigurations that block indexing, and the difference between crawl blocking and noindex.
Definition
Robots.txt is a plain-text file at the root of a host that communicates which URL paths site owners prefer search engine crawlers not to request—using User-agent and Disallow/Allow directives—without guaranteeing that disallowed URLs stay out of search results.
Robots.txt: crawl permission at the host level
Robots.txt is a text file at https://example.com/robots.txt that tells compliant crawlers which paths they should not request. It operates at the host level before individual page HTML is fetched. It is part of the Robots Exclusion Protocol (REP)—a convention, not a security mechanism.
Robots.txt controls crawl, not index directly. Misunderstanding that distinction causes accidental deindexing scenarios and "why is this still in Google?" support tickets.
Basic robots.txt syntax
User-agent: *
Disallow: /private/
Allow: /private/public-report/
User-agent: Googlebot
Disallow: /tmp/
Sitemap: https://example.com/sitemap.xml
Key directives:
- User-agent — which crawler the rules target (
*= all) - Disallow — path prefix crawlers should avoid requesting
- Allow — exceptions within disallowed paths (longest match wins in Google)
- Sitemap — optional URL to XML sitemap (discovery hint)
Paths are relative to the host root. Disallow: /blog blocks /blog and /blog/post unless Allow overrides match more specifically.
Robots.txt vs noindex
| Mechanism | Blocks fetch? | Keeps out of index? |
|---|---|---|
| robots.txt Disallow | Usually yes | Not guaranteed |
| meta robots noindex | No (page must be crawled to see tag) | Yes, when processed |
| X-Robots-Tag noindex | No | Yes, when processed |
Example: disallow-only mistake
Team disallows /promo/ in robots.txt hoping to hide launch pages. External blog links to promo URLs. Google never crawls them but lists URLs with snippetless results generated from anchor text. Fix: allow crawl + noindex until launch, or authenticate.
Example: blocking assets
Disallow: /static/
/static/ contains sitewide JavaScript required to render product copy. Smartphone Googlebot fetches blocked JS; rendered page looks empty. Fix: allow public assets; disallow only admin bundles.
Common robots.txt use cases
Save crawl budget
Block infinite calendars, internal search result pages, printer-friendly duplicates, and low-value session URLs.
Hide non-public environments
Staging should use authentication plus noindex—not only robots.txt on production copies.
Separate crawler policies
Rarely, different rules per bot:
User-agent: AdsBot-Google
Allow: /landing/
Most sites use one policy for * unless ad landing verification requires exceptions.
Robots.txt mistakes that break SEO
| Mistake | Symptom |
|---|---|
Disallow: / on production | Entire site uncrawlable |
| Wildcard misuse | Unintended path blocks |
| Wrong host file | www vs apex diverge |
| Blocking pagination needed for discovery | Orphaned series |
| Listing sitemap URLs also disallowed | Conflicting signals |
Example: CMS default robots
WordPress default Disallow: /wp-admin/ is fine; plugins sometimes add Disallow: / during maintenance mode and forget to remove it.
Example: international subdirectory block
Disallow: /de/
German market invisible to crawlers—traffic cliff in /de/ property. Intentional geo-blocking requires broader strategy than accidental robots paste.
Robots.txt and URL discovery
Disallowed URLs may still appear in search results without content snippets if linked externally. They also will not pass internal link equity through crawled paths if bots cannot fetch them—internal linking to disallowed URLs creates dead ends for Googlebot.
Sitemap entries pointing to disallowed URLs produce Search Console warnings. Align sitemap and robots policies.
Testing and monitoring robots.txt
Practices:
- Version-control robots.txt like application code
- Diff robots on deploy pipelines
- Alert when production
Disallow: /appears - Crawl with robots enabled vs disabled to measure impact
- Check both
httpandhttpsandwwwvariants
Google Search Console URL Inspection shows robots.txt fetch status for tested URLs.
Robots.txt limitations
- Not access control — malicious bots ignore it
- Not index control alone — use robots meta tag or X-Robots-Tag
- Not cross-domain — each host has its own file (
blog.example.comseparate fromwww) - Not retroactive magic — removing disallow does not instantly restore indexation
Robots.txt and JavaScript rendering
Google needs to crawl JS/CSS to render many pages. Overly broad disallow on /assets/ or CDN paths harms rendering quality. Use targeted disallows on secret paths only.
Enterprise robots.txt governance
Large organizations maintain:
- Central registry of path prefixes with owners
- Review board for new disallow requests
- Automated tests that critical templates remain allowed
- Documentation linking robots rules to indexation policy
Ad-hoc disallows by engineering during incidents often linger for years.
Robots.txt myths
- Myth: "Robots.txt removes pages from Google." Reality: use noindex or remove URLs publicly.
- Myth: "Blocking CSS improves SEO." Reality: harms rendering.
- Myth: "All bots must obey robots.txt." Reality: only polite crawlers; scrapers may not.
- Myth: "Robots.txt errors always block the whole site." Reality: depends which lines are wrong—partial blocks are common and subtle.
How Crawlox helps with robots.txt
Crawlox fetches and applies your live robots.txt during authorized crawls, showing which indexable URLs are accidentally disallowed, which assets block rendering, and where sitemap URLs conflict with disallow rules. Compare crawl coverage with robots enabled against your intended policy—catch production deploy regressions before crawlability collapses across entire template directories.
Related terms
Frequently asked questions
Does robots.txt block pages from Google search results?
Not reliably. Disallow prevents crawling; Google may still index URLs if they are linked externally without seeing noindex. To keep pages out of results while allowing crawl for link evaluation, use noindex via meta robots or X-Robots-Tag—not robots.txt alone.
Can I use noindex in robots.txt?
Google no longer supports noindex in robots.txt. Use HTML meta robots or X-Robots-Tag HTTP headers for index blocking.
What happens if robots.txt is missing?
Crawlers assume full allow by default. Missing robots.txt is not an error—only incorrect rules on production are dangerous.
Should I block /wp-admin/ or /cart/?
Blocking low-value or private paths is common to save crawl budget. Ensure you do not accidentally disallow CSS/JS needed for rendering public pages—Google needs assets to render modern sites.
How do I test robots.txt changes?
Use Search Console robots.txt tester (where available), fetch robots.txt per host, and run crawls that respect robots rules. Test staging and production separately—copy-paste errors between environments are frequent.
References
Explore authoritative guidance and frameworks related to robots.txt.
Explore every glossary definition
Return to the glossary to search by term, alias, starting letter, or category.