Skip to content
AI search and crawlers

What is robots.txt?

3 min read · Updated · By the Reveata team

Short answerRobots.txt is a plain-text file at the root of a website, such as example.com/robots.txt, that tells crawlers which paths they may and may not fetch, using groups of User-agent, Allow and Disallow lines. Crawlers follow it voluntarily; it does not block anyone.

Robots.txt has been around since 1994 and became an internet standard, RFC 9309 (opens in a new tab), in September 2022. It is the main way to tell search engines and AI companies what you want crawled.

How a robots.txt file is built

The file must be called /robots.txt, sit at the top level of the host, and be served as UTF-8 plain text. It is made of groups. Each group names one or more crawlers and lists rules for them:

text
User-agent: GPTBot
User-agent: CCBot
Disallow: /

User-agent: OAI-SearchBot
Allow: /

User-agent: *
Disallow: /admin/

Sitemap: https://example.com/sitemap.xml

The rules RFC 9309 sets out:

  • Matching names. A crawler matches its product token to the User-agent lines without regard to case. If no group names it, the * group applies.
  • Most specific rule wins. When an Allow and a Disallow both match a path, the longest match wins. Paths are case-sensitive. If nothing matches, the path is allowed.
  • Size. Crawlers should parse at least the first 500 KiB.
  • Caching. Crawlers may cache the file, but should not rely on a copy older than 24 hours unless the file cannot be reached.
  • Errors. If the file answers with a 4xx error, crawlers may fetch anything. If it answers with a 5xx error, they must assume everything is disallowed.

The Sitemap: line points crawlers to your XML sitemap and works in any position in the file.

What robots.txt cannot do

RFC 9309 says it plainly: these rules are not a form of access authorisation. Robots.txt asks; it does not enforce. A scraper can ignore it, and some operators say their user-triggered fetchers may not apply it. OpenAI says this of ChatGPT-User, Perplexity of Perplexity-User, and Google of user-triggered fetchers such as Google-Agent. If a page must stay private, put it behind a login.

Robots.txt also controls crawling, not indexing. Google notes that a URL blocked in robots.txt can still be indexed without its content, so use noindex on a crawlable page when you want it out of search results.

Robots.txt and AI crawlers

Operators run separate user agents for training, search and live answers, and many publish a token for each. That lets you, for example, refuse GPTBot and ClaudeBot while allowing OAI-SearchBot and Claude-SearchBot. Some tokens only exist in robots.txt: Google-Extended and Applebot-Extended never crawl themselves.

How Reveata helps

On the Bot traffic page you mark crawlers as allowed or blocked, and Reveata turns your choices into robots.txt lines to copy into your file. Each crawler's page in the crawler directory lists its robots.txt tokens and any note from the operator about whether it follows the file. Reveata does not enforce the rules for you. After a change, the Bot traffic page shows whether a crawler's hits actually fall, provided you forward crawler requests from your server.

Frequently asked questions

Where do I put robots.txt?

At the root of each host: https://example.com/robots.txt. A subdomain such as blog.example.com needs its own file, because rules apply per host.

Does blocking a crawler in robots.txt remove my pages from AI answers?

It stops well-behaved crawlers fetching them from then on. It does not remove content already collected, and user-triggered fetchers may still read a page when a person asks about it.

Can a mistake in robots.txt hurt my search traffic?

Yes. A Disallow: / under User-agent: * asks every crawler, search engines included, to stay away. Check the * group whenever you add rules for AI crawlers.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?