robots.txt
A text file at the root of a site that tells crawlers which paths they may request. It controls crawling, not indexing.
What it is
robots.txt follows the Robots Exclusion Protocol (RFC 9309). It lists user agents with Allow and Disallow rules and can point to the sitemap. Each host and protocol has its own file. A URL blocked here can still be indexed without content if other pages link to it.
Why it matters
A wrong rule can hide a whole section from search, or waste crawl on useless URLs. It also decides which AI crawlers may fetch your pages.
Common mistakes
- Leaving Disallow: / from staging on the live site
- Using robots.txt to hide a page from search results; use noindex or authentication instead
- Blocking a page that carries noindex, so the crawler never sees the tag
- Blocking CSS or JavaScript files that pages need to render
How I handle it
I read the live file, test important URLs against it, check that it names the sitemap, and decide AI crawler access on purpose rather than by default.
How to check it
- Open /robots.txt on every host you use and read it line by line.
- Test your key templates and a few parameter URLs against the rules.
- Confirm no rule blocks CSS, JavaScript or pages that need noindex.
- Make sure the sitemap is listed and the file returns 200.
Illustrative example
Example scenario: a redesign goes live with the staging robots.txt still saying Disallow: /. Traffic falls within days. Replacing the file fixes crawling, and the pages return as they are crawled again.
Frequently asked questions
Does robots.txt remove a page from Google?
No. It stops requests, but the URL can still be listed. To keep a page out, use noindex (the page must be crawlable) or put it behind a login.
Where does the file go?
In the root of each host, for example https://example.com/robots.txt. A subdomain needs its own file.
Related terms
Related services
Sources
- Robots.txt introduction and guide · Google Search Central
- RFC 9309: Robots Exclusion Protocol · IETF (RFC Editor)