Robots.txt Generator

Build a valid robots.txt file with rules per crawler, Allow and Disallow paths, crawl-delay and sitemap links.

Start from:
Group 1
* (all crawlers)
Googlebot - Google Search
Googlebot-Image - Google Images
Googlebot-News - Google News
Google-Extended - Google AI training control
Bingbot - Microsoft Bing
DuckDuckBot - DuckDuckGo
YandexBot - Yandex
Baiduspider - Baidu
Applebot - Apple
GPTBot - OpenAI
ChatGPT-User - OpenAI (user requests)
ClaudeBot - Anthropic
CCBot - Common Crawl
PerplexityBot - Perplexity
AhrefsBot - Ahrefs
SemrushBot - Semrush
facebookexternalhit - Facebook link previews
Twitterbot - X (Twitter) link previews
LinkedInBot - LinkedIn link previews
Custom user-agent...
Allow everything
Block everything
Custom Allow / Disallow paths
Group 2
* (all crawlers)
Googlebot - Google Search
Googlebot-Image - Google Images
Googlebot-News - Google News
Google-Extended - Google AI training control
Bingbot - Microsoft Bing
DuckDuckBot - DuckDuckGo
YandexBot - Yandex
Baiduspider - Baidu
Applebot - Apple
GPTBot - OpenAI
ChatGPT-User - OpenAI (user requests)
ClaudeBot - Anthropic
CCBot - Common Crawl
PerplexityBot - Perplexity
AhrefsBot - Ahrefs
SemrushBot - Semrush
facebookexternalhit - Facebook link previews
Twitterbot - X (Twitter) link previews
LinkedInBot - LinkedIn link previews
Custom user-agent...
Allow everything
Block everything
Custom Allow / Disallow paths

Upload the file to the root of your site, so it is served at /robots.txt. It is a request to well-behaved crawlers, not access control.

What robots.txt does, and what it does not

A robots.txt file is a plain text file at the root of a site that tells crawlers which URLs they may fetch. It is defined by the Robots Exclusion Protocol, published as RFC 9309 in 2022, and well-behaved crawlers such as Googlebot and Bingbot read it before crawling.

The key word is well-behaved. robots.txt is a request, not a lock. Nothing stops a scraper from ignoring it, and because the file is public, listing a secret folder in it actually advertises the folder. Anything private needs a password or server-side access control.

Key takeaways

  • robots.txt controls crawling, not indexing. A blocked URL can still appear in search results if other pages link to it.
  • It is advisory. Reputable crawlers obey it; bad actors do not.
  • The file must sit at the root of the host: https://www.example.com/robots.txt. Each subdomain needs its own.
  • Rules are grouped by User-agent. A crawler follows the most specific group that matches its name.
  • Google ignores Crawl-delay. Some other crawlers, including Bingbot, read it.

The file format

A robots.txt file is a series of groups. Each group starts with one or more User-agent lines naming the crawlers it applies to, followed by Allow and Disallow rules. Sitemap lines stand on their own and apply to the whole file. Here is the output for a typical online shop:

User-agent: *
Allow: /account/help/
Disallow: /cart/
Disallow: /checkout/
Disallow: /account/
Disallow: /*?sort=

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

This blocks the cart, checkout and account pages, which have no value in search, and blocks sorted versions of category pages, which would otherwise create many near-duplicate URLs. The Allow line carves the help section back out of the blocked account area.

DirectiveMeaningExample
User-agentWhich crawler the group is for; * means any crawler without a more specific groupUser-agent: Googlebot
DisallowPaths the crawler should not fetch; an empty value allows everythingDisallow: /private/
AllowExceptions inside a disallowed pathAllow: /private/press/
SitemapFull URL of an XML sitemap; may be repeatedSitemap: https://www.example.com/sitemap.xml
Crawl-delaySeconds to wait between requests; not in RFC 9309 and ignored by GoogleCrawl-delay: 10

Allow all versus block all

The two presets produce the two shortest useful files. Allow all:

User-agent: *
Disallow:

Block all:

User-agent: *
Disallow: /

The difference is one character. An empty Disallow allows everything; Disallow: / blocks every URL on the site. Block all is right for a staging site, but it is also a common way that a site disappears from search after launch, when the staging file is copied to production by mistake. Check the live file after every deployment.

Blocking a page does not remove it from search. If a blocked URL has links pointing to it, a search engine may still list it, usually without a description, because it is not allowed to read the page. To keep a page out of results, let it be crawled and add a noindex robots meta tag or X-Robots-Tag header instead. A crawler cannot see a noindex tag on a page robots.txt stops it from fetching.

Rules for specific crawlers

Add a group for each crawler that needs different rules. A crawler uses the group whose User-agent best matches its own name and ignores the rest, including the * group. That catches people out: if you give Googlebot its own group, the rules in the * group no longer apply to Googlebot, so repeat any that should.

This example allows everyone, blocks OpenAI's GPTBot entirely and asks Bingbot to slow down:

User-agent: *
Disallow:

User-agent: GPTBot
Disallow: /

User-agent: Bingbot
Disallow:
Crawl-delay: 10

The crawler list in the tool includes the main search engines, several AI and dataset crawlers (GPTBot, ClaudeBot, CCBot, PerplexityBot), the Google-Extended control token, SEO tool crawlers and social preview bots. Crawler names change and new ones appear, so confirm a token in the operator's own documentation before relying on it. User-agent matching is case-insensitive.

Blocking social preview bots such as facebookexternalhit or Twitterbot stops link previews from working for your pages. Block them only if that is what you want.

How paths and wildcards match

  • Every path starts with /. The tool rejects paths that do not, such as private/ or *.pdf, and leaves them out of the file until fixed.
  • Rules match prefixes. Disallow: /blog blocks /blog, /blog/ and also /blog-archive. Add a trailing slash, Disallow: /blog/, to block only the folder.
  • * matches any run of characters and $ marks the end of the URL. Disallow: /*.pdf$ blocks URLs ending in .pdf.
  • Paths are case-sensitive. /Admin/ and /admin/ are different paths.
  • The longest matching rule wins for Google and other RFC 9309 crawlers, regardless of order. If an Allow and a Disallow rule are equally long, Allow wins.

Crawl-delay and sitemaps

Crawl-delay asks a crawler to wait a number of seconds between requests. It was never part of the standard. Google ignores it and adjusts its crawl rate automatically based on how quickly your server responds; Bingbot is among the crawlers that read it. Only use it if a specific crawler is putting real load on your server, because a long delay can stop a large site from being crawled fully.

Sitemap lines tell crawlers where your XML sitemaps are. They must be full URLs, including https://, and you can list as many as you need. The tool rejects relative paths such as /sitemap.xml. Listing sitemaps here is optional if you submit them in each search engine's webmaster tools, but it costs nothing and helps crawlers that you have not registered with.

After uploading, open /robots.txt in a browser to confirm it loads as plain text at the root of the right host. Google Search Console includes a robots.txt report that shows the version Google last fetched and any lines it could not parse, which is the quickest way to catch a typo before it costs you traffic.

Everything runs in your browser. The file is built on your device; nothing you enter is uploaded or stored.

Frequently Asked Questions

Where do I put robots.txt?

In the root of your site, so it loads at https://yourdomain.com/robots.txt. Crawlers do not look for it anywhere else, and a robots.txt in a subfolder is ignored. Each subdomain and each protocol-and-host combination needs its own file.

Does robots.txt stop a page appearing in Google?

Not reliably. It stops crawling, not indexing. A blocked page can still be listed if other sites link to it. To keep a page out of search results, allow crawling and use a noindex meta tag or X-Robots-Tag header.

Can robots.txt protect private content?

No. It is a public file that polite crawlers choose to follow. Anyone can read it and anyone can ignore it. Protect private content with authentication or server-side access rules.

What is the difference between Disallow: and Disallow: /?

An empty Disallow: allows everything. Disallow: / blocks the whole site. The single slash is the difference between a fully crawlable site and one that search engines stop crawling.

Does Google follow Crawl-delay?

No. Google ignores the Crawl-delay line and sets its crawl rate automatically based on how your server responds. Some other crawlers, including Bingbot, do read it.

How do I block AI crawlers?

Add a group for each crawler's user-agent token with Disallow: /, for example GPTBot or CCBot. Each AI company publishes its own token, and some use separate tokens for training and for fetching pages on a user's request, so check their documentation. Compliance is voluntary, as with any robots.txt rule.

If I add a Googlebot group, does the * group still apply to Googlebot?

No. A crawler follows only the most specific group that matches it. Once Googlebot has its own group, it ignores the * group entirely, so copy any shared rules into the Googlebot group as well.

Do I need a robots.txt file at all?

No. If there is no robots.txt, crawlers assume they may fetch everything. A file is useful when you want to keep crawlers out of low-value areas such as carts and internal search results, or to point them to your sitemaps.

Why does the tool reject my path?

Paths in Allow and Disallow rules must start with a forward slash, such as /private/ or /*.pdf$, and cannot contain spaces. Paths that break these rules are left out of the file and listed so you can fix them.

Related Calculators