Glossary · SEO & AI search

What is robots.txt?

robots.txt is a plain-text file at the root of a website (/robots.txt) that tells crawlers which URLs they are allowed or not allowed to request, using the Robots Exclusion Protocol, standardized as RFC 9309 in 2022.

Also called: Robots exclusion protocol, REP

Updated

robots.txt syntax

User-agent: *
Disallow: /app/
Allow: /app/public/

User-agent: GPTBot
Disallow: /

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

Rules are grouped by User-agent. Disallow and Allow take path prefixes, with * as a wildcard and $ for end of URL. The most specific matching rule wins. A crawler follows the group that best matches its name, falling back to *. Sitemap lines are independent of groups.

robots.txt for AI crawlers

GoalRule
Keep content out of OpenAI training, stay in ChatGPT searchDisallow GPTBot; allow OAI-SearchBot and ChatGPT-User
Opt out of Gemini training without leaving Google SearchDisallow the Google-Extended token
Opt out of Anthropic trainingDisallow ClaudeBot
Opt out of Common Crawl datasetsDisallow CCBot

Generate a file for the bots you choose with the AI crawler robots.txt generator.

What robots.txt can't do

  • It doesn't stop indexing. A disallowed URL can still be indexed (without content) if other pages link to it. Use a noindex meta tag or header — on a page crawlers are allowed to fetch.
  • It isn't security. It's public, and badly behaved bots ignore it. Protect private content with authentication.
  • Google ignores some directives, such as crawl-delay and noindex lines in robots.txt.
  • Size limit. Google processes the first 500 KiB.

robots.txt example mistake

A team blocks /blog/ during a redesign and forgets to remove the rule. Within weeks, Search Console reports blog URLs as "Indexed, though blocked by robots.txt" with no snippets, and organic clicks fall. A one-line change fixes it — test changes with a robots.txt tester before deploying.

robots.txt and VisitTrack

robots.txt says what crawlers are allowed to do; VisitTrack's AI crawler tracking shows what they actually do — which bots fetched which paths, verified by reverse DNS where possible. That's how you check whether a block is respected, and whether allowing answer bots like ChatGPT-User leads to referred visits from AI assistants.

Frequently asked questions

Does robots.txt block AI crawlers?

It asks them not to crawl, and the major AI companies say their crawlers respect it, but compliance is voluntary. Blocking a training crawler like GPTBot doesn't necessarily block that company's live-fetch or search crawlers, which use different user agents.

Can robots.txt remove a page from Google?

No. Blocking crawling can leave a URL indexed without its content. To remove a page, allow crawling and add a noindex meta tag or X-Robots-Tag header, or use Search Console's removal tool for a temporary removal.

Related terms

Tools and guides

See which channels actually bring paying customers

VisitTrack is cookie-free analytics with revenue attribution built in. One script tag, no consent banner, live in two minutes. 14 days free, no card required.