What robots.txt does, and what it does not
robots.txt is a plain-text file at the root of your site that tells crawlers which URLs they may fetch. Well-behaved bots (Googlebot, Bingbot, most AI crawlers from large companies) read it before crawling. It is a request, not a lock: bad bots ignore it, and anyone can read the file.
It also does not remove pages from search. A blocked URL can still appear in Google if other sites link to it, just without a description. To keep a page out of results, let it be crawled and add a noindex robots meta tag with the meta tag generator.
How the rules work
- User-agent starts a group.
*means every crawler; a name likeBingbottargets one. - Disallow blocks a path prefix.
/admin/blocks everything under it. An emptyDisallow:allows everything. - Allow makes an exception inside a blocked folder. The longest matching rule wins.
- *`
and$** are wildcards:/*.pdf$` blocks every URL ending in .pdf. - Crawl-delay asks for seconds between requests. Bing and Yandex use it; Google ignores it.
- Sitemap lines can go anywhere and point crawlers at your XML sitemap.
A crawler follows only the most specific group that names it. If you add a group for Bingbot, Bingbot ignores the * group entirely, so repeat any shared rules there.
Blocking AI training crawlers
The AI toggle adds a group that disallows the main training crawlers: GPTBot (OpenAI), ClaudeBot (Anthropic), Google-Extended (Gemini training), CCBot (Common Crawl), PerplexityBot, Bytespider (ByteDance), Applebot-Extended and meta-externalagent (Meta). Google-Extended and Applebot-Extended are control tokens, so blocking them does not affect Google Search or Siri. Weigh it before you switch it on: blocking AI crawlers can also keep your product out of AI answers. If you want to be cited, an llms.txt file helps instead.
Common mistakes
- Blocking CSS and JS folders, which stops Google rendering the page.
- Leaving
Disallow: /from a staging site on the live domain. - Using robots.txt to hide private content. Use authentication instead.
Test any URL against your finished file with the robots.txt tester.