What Is robots.txt?
robots.txt is a text file at the root of a site that tells crawlers which paths they may or may not crawl.
robots.txt is a plain text file placed at the root of a domain, for example example.com/robots.txt. It contains rules for crawlers: which user agents the rules apply to, which paths they should not crawl, and often the location of the XML sitemap. Well-behaved crawlers read it before crawling the site.
What robots.txt does and does not do
- It controls crawling, not indexing. A blocked URL can still appear in search if other sites link to it.
- To keep a page out of search results, allow crawling and use a "noindex" meta tag or header instead.
- It is not a security tool. Anyone can read the file, and bad bots can ignore it.
Common uses
- Blocking internal search results, filter combinations and cart pages to save crawl budget.
- Keeping staging or admin areas away from crawlers, alongside proper password protection.
- Pointing crawlers to the sitemap.
- Setting rules for specific bots, including AI crawlers.
Costly mistakes
A single wrong line, such as "Disallow: /" left over from a staging site, can block the whole site. Blocking CSS or JavaScript files can stop search engines from rendering pages correctly.
How we handle it
We review robots.txt rules against crawl data in every technical SEO audit, and set AI crawler rules as part of AI SEO services. Our web scraping work respects robots.txt on the sites we collect from.
Need help with this on your website?
