Robots.txt Generator

Build a valid robots.txt file with allow and disallow rules per crawler, crawl-delay and sitemap links, and test whether a URL would be blocked. Free online robots.txt generator.

Start from a preset
User-agent groups
Group 1
Rules
robots.txt
User-agent: *
Disallow: /admin/
Allow: /admin/public/

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

URL tester

Test against
Blocked/admin/settings

Decided by "Disallow: /admin/" on line 2: the longest matching rule wins, and Allow wins a tie.

Group applied: *

Usage examples

Keep an admin area out of the crawl but expose one folder

Add Disallow: /admin/ and Allow: /admin/public/ to the * group. The tester confirms /admin/settings is blocked while /admin/public/help is allowed, because the longer Allow path wins.

Opt out of AI training without leaving search

Apply the Block AI training crawlers preset. It disallows GPTBot, ClaudeBot, Google-Extended, Applebot-Extended and CCBot, while Googlebot and Bingbot keep crawling as before.

Stop crawlers wasting time on filter URLs

Add Disallow: /*?sort= and Disallow: /*&sort= so sorted duplicates of category pages are skipped, then test /shoes?color=red&sort=price to see the second rule catch it.

Find out why Googlebot cannot fetch a page

Paste your live robots.txt into the tester, enter the URL that Search Console reports as blocked, and see the exact line and rule that blocks it and which user-agent group was used.

Point crawlers to several sitemaps

List your main sitemap and, for example, a news or image sitemap, one URL per line. Sitemap lines are not tied to a group, so every crawler that reads the file can find them.

Quick reference

Which rule wins (Google and RFC 9309 precedence)

RulesPathResultDeciding rule
Allow: /p · Disallow: //pageAllowedAllow: /p
Allow: /folder · Disallow: /folder/folder/pageAllowedAllow: /folder
Allow: /page · Disallow: /*.html/page.htmlBlockedDisallow: /*.html
Allow: /$ · Disallow: //AllowedAllow: /$
Allow: /$ · Disallow: //page.htmlBlockedDisallow: /
Disallow: /*.php$/index.phpBlockedDisallow: /*.php$
Disallow: /*.php$/index.php?id=1AllowedNo match (allowed)
Disallow: /fish/Fish.aspAllowedNo match (allowed)
Disallow: /*?/search?q=shoesBlockedDisallow: /*?

AI crawler user agents (from each vendor's documentation)

User-agent tokenCompanyPurpose
GPTBotOpenAICollects or controls use of content for AI model training
OAI-SearchBotOpenAIIndexes pages for the vendor's AI search answers
ChatGPT-UserOpenAIFetches a page when a user asks the assistant
ClaudeBotAnthropicCollects or controls use of content for AI model training
Claude-SearchBotAnthropicIndexes pages for the vendor's AI search answers
Claude-UserAnthropicFetches a page when a user asks the assistant
Google-ExtendedGoogleCollects or controls use of content for AI model training
Applebot-ExtendedAppleCollects or controls use of content for AI model training
CCBotCommon CrawlCollects or controls use of content for AI model training
PerplexityBotPerplexityIndexes pages for the vendor's AI search answers

Frequently asked questions

Where do I put the robots.txt file?

At the root of the host, for example https://example.com/robots.txt. It only applies to that exact protocol, host and port, so shop.example.com or http:// versions need their own file. Google reads up to 500 KiB and ignores anything after that.

Does Disallow remove a page from Google?

No. Disallow stops crawling, not indexing: a blocked URL can still appear in results, without a description, if other pages link to it. To keep a page out of the index, allow crawling and add a noindex meta tag or X-Robots-Tag header, because Google cannot see noindex on a page it is not allowed to fetch.

Which rule wins when Allow and Disallow both match?

The rule with the longest path wins, counting every character including * and $. If an Allow and a Disallow rule are the same length, Allow wins. This is how Google and RFC 9309 define it, and the order of lines in the file does not matter. The tester shows every matching rule in priority order.

Does Google support crawl-delay?

No. Google lists crawl-delay as unsupported and ignores it; Googlebot adjusts its crawl rate automatically and slows down when your server returns 500, 503 or 429 errors. Bing does honor crawl-delay, treating it as a time window in which it fetches at most one page.

How do I block AI crawlers?

Add a group for each vendor's token with Disallow: /, for example GPTBot, ClaudeBot, Google-Extended, Applebot-Extended and CCBot for training. Google-Extended does not affect Google Search, and Applebot-Extended does not crawl but controls how Apple uses content. Compliance is voluntary, and OpenAI says robots.txt rules may not apply to user-initiated ChatGPT-User visits.

Is robots.txt a way to hide private pages?

No. The file is public, so listing /secret-admin/ actually advertises it, and badly behaved bots ignore it anyway. Protect private content with authentication or IP restrictions, and use robots.txt only to manage how well-behaved crawlers spend their time.

How do * and $ work in paths?

* matches any sequence of characters, including none, and $ at the end means the URL must end there. Disallow: /*.pdf$ blocks /files/guide.pdf but not /guide.pdf?download=1. Paths are case-sensitive (/Fish is not /fish), while user-agent names are not.