Webmaster Bench

Tools / robots.txt Generator

robots.txt Generator

Fill in what crawlers may not fetch, choose which AI crawlers to turn away, add your sitemap, and copy the file. The result is checked as you go.

Default for all crawlers
Block these AI crawlers completely
Test it in the tester

What goes in a robots.txt file

robots.txt is a plain-text file at the root of a host (https://www.example.com/robots.txt) that tells crawlers which URLs they may fetch. It has three things you will normally use:

  • Groups, each starting with User-agent: lines naming the crawlers it applies to (* means every crawler without a group of its own).
  • Rules in each group: Disallow: /path blocks every URL whose path starts with /path; Allow: re-opens part of a blocked area. The longest matching rule wins.
  • Sitemap lines: Sitemap: https://..., anywhere in the file, outside groups. They help every search engine find your sitemaps.

The generator writes the AI-crawler and other blocked groups first, then the * group with your rules, then the sitemaps. Order between groups does not matter to crawlers, but this layout is easy to read.

Worked examples

A typical shop

User-agent: *
Disallow: /cart/
Disallow: /checkout/
Disallow: /*?sort=
Disallow: /*&sort=

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

Carts and checkouts are private and endless; sort parameters create thousands of duplicate listing URLs. Product and category pages stay open. Note that /*?sort= only matches when sort is the first parameter, so the second rule covers it in any other position.

A staging site

User-agent: *
Disallow: /

This stops well-behaved crawlers, but it is not access control: anyone can still open the pages, and URLs linked from elsewhere can still be indexed without content. Protect staging sites with a password (HTTP authentication) instead, which also keeps them out of search.

Opting out of AI training but staying in search

User-agent: GPTBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: *
Disallow:

GPTBot (OpenAI) and Google-Extended (Google's control for use in Gemini models) are turned away; Googlebot, Bingbot and every other crawler keep full access. Google-Extended is not a separate crawler: it is a token Google checks when deciding how content fetched by its normal crawlers may be used, so blocking it does not affect Google Search.

AI crawler tokens

TokenOperatorWhat blocking it does
GPTBotOpenAIStops collection for training OpenAI models. OpenAI's search crawler (OAI-SearchBot) and user-triggered fetches (ChatGPT-User) are separate tokens.
ClaudeBotAnthropicStops collection for training Anthropic models.
Google-ExtendedGoogleStops use in Gemini training and grounding. No effect on Google Search ranking or inclusion.
Applebot-ExtendedAppleStops use in Apple's AI training; Applebot still crawls for Siri and Spotlight.
CCBotCommon CrawlStops the open web archive that many AI datasets are built from.
PerplexityBotPerplexityStops indexing for Perplexity's answer engine.
Meta-ExternalAgentMetaStops collection for Meta's AI training.
BytespiderByteDanceStops ByteDance's crawler.

robots.txt is a request, not an enforcement mechanism. The operators above say they honour it; others may not. Crawler names change, so check each operator's documentation from time to time.

Pitfalls

  • Do not block pages you want removed from Google. Use noindex instead; a blocked page cannot show Google its noindex tag.
  • Do not block CSS and JavaScript that pages need to render.
  • Paths are case-sensitive and must start with / (or *).
  • A named group replaces the * group for that crawler. If you add User-agent: Googlebot, repeat in it every rule from * that should also apply to Googlebot.
  • Keep the file under 500 KiB; Google ignores the rest. Save it as UTF-8 plain text.
  • One file per host and protocol. Subdomains need their own.

Sources

Last reviewed 2026-11-15. Your input is processed only in your browser and never sent to us.