Skip to content
Tools

Robots.txt Generator

Generate a valid robots.txt file for your website by configuring crawler rules, allowed paths, disallowed paths and sitemap locations.

Build the file with the form, or edit it as text

Start from an example

Each replaces what is in the builder. What belongs in a robots.txt depends on the site — these are starting points, not recommendations.

  • Group 1*

    User-agent
    • *

    *A crawler only falls back to this group when no more specific token matches it. Give Googlebot its own group and it stops reading this one entirely.

    Rules

Sitemaps

Must be an absolute URL. Sitemap lines sit outside the groups and apply to every crawler, whichever group it reads.

Generated robots.txt

24 bytes · 2 lines

User-agent: *
Disallow:

Upload this to the root of your site, at /robots.txt. It has no effect anywhere else.

Validation

1 note

  • NoteNo sitemap is declared.

    Not required, but a `Sitemap:` line is the cheapest way to tell every crawler where your URLs are — and it applies to all of them, regardless of the groups above.

Everything runs locally in your browser. Nothing you type is uploaded to our server.

What is robots.txt?

A plain-text file at the root of a site — /robots.txt — telling crawlers which parts of it they may fetch. It has been a convention since 1994 and a standard, RFC 9309, since 2022.

The word to hold on to is telling. robots.txt asks; it does not enforce. Search engines and the major AI crawlers honour it because being blocked is the point of announcing yourself. Anything acting in bad faith ignores it, and there is nothing in the file that could stop it.

How robots.txt works

A robots.txt is a list of groups. Each group names one or more crawlers and carries the rules for them:

One group, three rules, one sitemap
User-agent: *Disallow: /admin/Disallow: /private/Allow: /private/public/ Sitemap: https://example.com/sitemap.xml

Now the part that catches almost everyone out. A crawler obeys exactly one group — the most specific one whose token matches its name — and ignores every other group in the file. Rules do not accumulate.

This does not do what it looks like it does
User-agent: *Disallow: /internal/ User-agent: GooglebotDisallow: /drafts/ # Googlebot reads only its own group.# /internal/ is NOT blocked for Googlebot — the rule has to be repeated.

The builder flags this whenever a named crawler sits beside a * group that has rules of its own. It is a warning rather than an error, because the arrangement is sometimes exactly what you want — but it is almost never what someone means the first time they write it.

How to create a robots.txt

  • Build the groups above — start from User-agent: *, which is the fallback every crawler without its own group will read.
  • Add Disallow rules for paths not worth crawling, and Allow for any exception inside them.
  • Declare your sitemap. It is one line and it applies to everything.
  • Read the validation panel — errors first, then the warnings.
  • Download the file and upload it to the root of your site, at /robots.txt. In a subdirectory it is never read.

One detail worth knowing: robots.txt is per host, per scheme and per port. example.com and blog.example.com need separate files, and neither inherits from the other.

User-agent directives

The value after User-agent: is a product token, not a User-Agent header. Googlebot’s header is a full Chrome string; its robots.txt token is just Googlebot. Confusing the two produces a group that never matches anything.

Matching has three properties worth remembering:

  • Case-insensitive. googlebot and Googlebot are the same.
  • Prefix-based. Googlebot also matches Googlebot-News, which is why the more specific tokens exist.
  • Most specific wins, not first in the file. Order is irrelevant.

Consecutive User-agent lines share one group, which is how you give several crawlers identical rules without repeating them:

Two crawlers, one group
User-agent: GooglebotUser-agent: BingbotDisallow: /admin/

Allow vs Disallow

Disallow asks crawlers not to fetch URLs beginning with a path. Allow carves an exception out of one. Both take a path from the root of the site, so both begin with a slash.

Two values look almost identical and mean opposite things:

One character apart
Disallow: /      # block everythingDisallow:        # block nothing

When several rules match a URL, Google and Bing apply the one with the longest matching path, whether it allows or disallows. Order in the file has no effect. Where two matching rules are the same length, Google resolves the tie in favour of Allow.

Wildcards are supported by the major crawlers and by RFC 9309: * matches any run of characters, and $ anchors the end of the URL.

Patterns
Disallow: /*?sort=     # any URL containing that parameterDisallow: /*.pdf$      # any URL ending in .pdfDisallow: /admin/      # the folder and everything under itDisallow: /admin/*     # identical to the line above — the * adds nothing

Paths are case-sensitive, because URLs are. Blocking /Admin/ does nothing about /admin/.

The Sitemap directive

Sitemap: is a non-group directive: it sits outside every User-agent block and applies to all crawlers whichever group they read. Position in the file makes no difference, and you can list several.

Sitemap lines
Sitemap: https://example.com/sitemap.xmlSitemap: https://example.com/sitemap-news.xml

The URL must be absolute, with the scheme. /sitemap.xml on its own is ignored — the generator treats a relative URL as an error rather than quietly writing a line that does nothing. If there is no sitemap at that address yet, the sitemap generator builds the XML file this line points at.

Crawl-delay and crawler load

Crawl-delay asks for a pause between fetches. It is not in RFC 9309 and support is uneven, so the builder shows which of the crawlers in a group will actually honour it.

Google never has, and says so plainly. The line is read and discarded. Crawl rate for Googlebot is adjusted in Search Console. Bingbot, CCBot, Applebot, YandexBot and several SEO crawlers do honour it.

If crawling is genuinely overloading your server, the reliable signal is an HTTP status rather than a directive: return 429 or 503 and every well-behaved crawler backs off, including the ones that ignore Crawl-delay.

What robots.txt cannot do

Three things it is regularly asked to do and cannot:

  • It does not remove pages from search results. A blocked URL can still be indexed if something links to it — listed without a description, because the crawler was never allowed to read the page.
  • It does not protect anything. There is no enforcement, and the file is public.
  • It does not bind anyone. Honouring it is voluntary. Scrapers ignore it entirely.

The first is worth dwelling on, because the usual fix makes it worse. To keep a page out of the index you serve a noindex meta tag or X-Robots-Tag header — and the crawler has to fetch the page to see it. Block the page in robots.txt and it never will, so a page that is both blocked and tagged noindex can stay indexed indefinitely. Allow the crawl, serve noindex, wait for it to drop out, then block it if you still want to. The meta tag generator writes therobots meta tag that carries the noindex value.

robots.txt vs meta robots

A comparison of robots.txt and the meta robots tag across scope, what they control and when each is the right tool.
robots.txtmeta robots / X-Robots-Tag
ControlsCrawling — may this URL be fetchedIndexing — may this page appear in results
ScopeThe whole host, from one fileOne page, or one response
Seen whenBefore anything is fetchedOnly if the page is crawled
Use it toKeep crawlers out of low-value areasKeep a page out of the index

They are complementary, and using both on the same URL is self-defeating for the reason above. Reach for robots.txt when the goal is to stop crawling from being wasted; reach for noindex when the goal is to stop a page appearing in results. When the goal is neither — the page should stay reachable, but a different URL is the one you want counted — a canonical tag is the right instrument.

robots.txt is not access control

Your robots.txt is public. Anyone can open /robots.txt on any site right now, and plenty of people do exactly that when they are looking for something interesting.

So a line like Disallow: /admin/ announces where your admin panel is while doing nothing at all to stop anyone opening it. The file has no enforcement of any kind — it is a note asking politely, addressed to software that may or may not be listening.

Anything that must not be reached needs authentication and authorisation on the server. And if a path is genuinely sensitive, the right move is to keep it out of robots.txt altogether rather than advertise it — which is why the generator warns when a disallowed path contains something like admin, backup or .env.

AI crawlers

The major AI operators publish product tokens precisely so their crawlers can be blocked in robots.txt. As with every other crawler, compliance is voluntary — but these are the operators who chose to be blockable.

AI-related crawler tokens, their operators and what each is used for.
TokenOperatorUsed for
Google-ExtendedGoogleControls use of your content for Gemini and Vertex AI grounding
GPTBotOpenAICollects content to train OpenAI models
OAI-SearchBotOpenAIIndexes content for search results in ChatGPT
ClaudeBotAnthropicCollects content for Anthropic models
PerplexityBotPerplexityIndexes content for Perplexity answers
CCBotCommon CrawlBuilds the open Common Crawl corpus, widely used for AI training

Google-Extended is the odd one out and worth understanding: it is not a crawler and fetches nothing. It is a token you disallow to opt your content out of Gemini training and grounding, and doing so has no effect on Search crawling, indexing or ranking.

Note too that blocking an AI crawler is a separate decision from blocking a search crawler. GPTBot gathers training data; OAI-SearchBot indexes content so it can appear in ChatGPT search results. Blocking the first and allowing the second is a coherent position.

Common examples

All six are available as templates in the builder above, and each is generated by the same code that produces your file.

Allow everything

The default for most sites — nothing blocked, sitemap declared

User-agent: *Disallow: Sitemap: https://example.com/sitemap.xml

Block everything

A staging or holding site that should not be crawled at all

# Staging site — not for indexing. User-agent: *Disallow: /

Typical site

Keeps crawlers out of admin, search results and cart pages

User-agent: *Disallow: /cart/Disallow: /checkout/Disallow: /searchDisallow: /*?sort= Sitemap: https://example.com/sitemap.xml

Block a folder, allow one file

Shows how Allow carves an exception out of a Disallow

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

Opt out of AI training

Leaves search crawlers alone and blocks the AI ones

# Search crawlers are unaffected; AI training crawlers are blocked. User-agent: *Disallow: User-agent: GPTBotUser-agent: ClaudeBotUser-agent: CCBotUser-agent: PerplexityBotUser-agent: Google-ExtendedDisallow: / Sitemap: https://example.com/sitemap.xml

Different rules per crawler

Shows that a named crawler ignores the * group completely

# Googlebot has its own group, so it does not read the * rules at all.# Anything that should apply to it has to be repeated here. User-agent: *Disallow: /internal/ User-agent: GooglebotDisallow: /internal/Disallow: /drafts/ Sitemap: https://example.com/sitemap.xml

Frequently asked questions

What is robots.txt?

A plain-text file at the root of a site telling crawlers which parts of it they may fetch. It is a request, not a barrier: well-behaved crawlers read it and honour it, and anything else ignores it. The format was standardised as RFC 9309 in 2022, after nearly thirty years as a convention.

Where should robots.txt be placed?

At the root of the host, at /robots.txt — https://example.com/robots.txt and nowhere else. A file in a subdirectory is never read. It is also per-host, per-scheme and per-port: https://example.com and https://blog.example.com need their own, and so, strictly, do the http and https versions of the same host.

What does User-agent: * mean?

It opens the fallback group — the rules for any crawler that has no group of its own. The important half is what it does not mean: a crawler with its own group ignores the * group completely. Give Googlebot a group and it stops reading the * rules, even the ones you meant to apply to everything.

What does Disallow: / mean?

It asks the matching crawlers not to fetch any URL on the site. It is the correct line for a staging site and the single most damaging line a live site's robots.txt can contain. Note the contrast with an empty `Disallow:`, which explicitly disallows nothing — one character apart, opposite meanings.

How do I allow a specific URL inside a blocked folder?

Use Allow for the exception, in the same group: `Disallow: /private/` followed by `Allow: /private/public/`. Google and Bing resolve the two by picking the longest matching rule, so the more specific Allow wins for URLs under /private/public/. Where two rules are the same length, Google breaks the tie in favour of Allow.

Can robots.txt block Google?

It can ask Googlebot not to crawl, and Googlebot honours that. What it cannot do is keep the URL out of the search results — Google may still index a blocked URL it finds linked elsewhere, listing it without a description because it was never allowed to read the page.

Can robots.txt remove a page from Google?

No, and using it that way usually backfires. To keep a page out of the index you need a `noindex` meta tag or an `X-Robots-Tag` header — and Google has to crawl the page to see either. Blocking the page in robots.txt prevents that, so a page blocked and tagged noindex can stay indexed indefinitely. Let it be crawled, serve noindex, and remove the block once it has dropped out.

Can robots.txt protect private pages?

No. It is a public file — anyone can read yours right now — and it has no enforcement of any kind. Listing `Disallow: /admin/` tells every visitor exactly where your admin panel is while doing nothing to stop them opening it. Anything that must not be reached needs authentication and authorisation on the server. If a path is sensitive, keep it out of robots.txt entirely.

What is the difference between Allow and Disallow?

Disallow asks crawlers not to fetch URLs matching a path; Allow carves an exception out of a Disallow. Allow was not in the original 1994 convention — it arrived later and is now part of RFC 9309 and supported by every major crawler — which is why some very old parsers understand only Disallow.

How do I add a sitemap to robots.txt?

One line: `Sitemap: https://example.com/sitemap.xml`. It must be an absolute URL including the scheme; a relative path is ignored. Sitemap lines are non-group directives, so they sit outside every User-agent block and apply to all crawlers regardless of which group they read. You can list several.

Can robots.txt contain comments?

Yes. Anything after a # is a comment, whether it starts the line or follows a directive. Comments are worth using — a robots.txt is edited rarely and by whoever happens to be on call, and a line saying why a path is blocked saves someone unblocking it by mistake.

Does every crawler follow robots.txt?

No. Honouring it is voluntary. The major search engines do, and the well-known AI crawlers publish tokens precisely so they can be blocked. Scrapers, harvesters and anything acting in bad faith do not, and nothing in the file can make them — which is the same reason it is not a security measure.

What is Crawl-delay?

A request to wait a given number of seconds between fetches, intended to relieve load on a small server. It is not in RFC 9309 and support is uneven.

Is Crawl-delay supported by Google?

No. Google has never honoured Crawl-delay and says so explicitly; the line is read and discarded. Bing, Yandex and several SEO crawlers do honour it. For Google, crawl rate is adjusted in Search Console — and if crawling is genuinely overloading your server, returning 429 or 503 is the signal every crawler understands.

Can I have multiple user-agent groups?

Yes, and it is the normal way to give different crawlers different rules. The thing to remember is that a crawler obeys exactly one group — the most specific one matching its name — and rules never accumulate across groups. Anything from the * group that should also apply to a named crawler has to be repeated inside that crawler's own group.

Is robots.txt case-sensitive?

Half of it. Directive names and user-agent tokens are case-insensitive, so `Disallow` and `disallow` are the same and `Googlebot` matches `googlebot`. Paths are case-sensitive, because URLs are — `/Admin/` and `/admin/` are different rules and blocking one does not block the other.

Can I use wildcards in robots.txt?

Yes, with the major crawlers and under RFC 9309. `*` matches any run of characters and `$` anchors the end of the URL, so `Disallow: /*?sort=` blocks any URL containing that parameter and `Disallow: /*.pdf$` blocks URLs ending in .pdf. A trailing `*` on a folder is redundant, though — matching is already a prefix match, so `/admin/*` and `/admin/` are identical.

How does a crawler decide which rule wins?

By length. Google and Bing compare every rule in the chosen group against the URL and apply the one with the longest matching path, whether it is an Allow or a Disallow. Order in the file is irrelevant. When two matching rules are the same length, Google prefers Allow.

What is the difference between robots.txt and the meta robots tag?

robots.txt controls crawling — whether a URL may be fetched at all — and lives in one file for the whole site. The meta robots tag and the X-Robots-Tag header control indexing of one page, and are only seen if that page is crawled. Use robots.txt to keep crawlers out of areas that waste crawl budget, and noindex to keep a page out of results. Using both on the same URL is self-defeating.

Can I block AI crawlers with robots.txt?

You can ask them not to crawl, and the major operators publish tokens for exactly that — GPTBot and OAI-SearchBot for OpenAI, ClaudeBot for Anthropic, PerplexityBot, CCBot for Common Crawl. Google-Extended is a special case: it is not a crawler and fetches nothing, but disallowing it opts your content out of Gemini training and grounding without affecting Search. As with every other crawler, compliance is voluntary.

What happens if robots.txt is missing or returns an error?

A 404 means no restrictions, and crawlers proceed as if the file were empty — which is fine for most sites. A 5xx is different: Google treats a persistent server error as a signal to stop crawling the site entirely, on the assumption that the file exists but cannot be read. A broken robots.txt endpoint is worse than no robots.txt.

Is there a size limit?

Google reads the first 500 KiB and ignores everything after it. That is a very large robots.txt, but a file generated from a database of URLs can reach it — and the failure is silent, because the truncated rules simply stop applying. Prefer patterns over long lists.

Are Noindex or Host directives valid in robots.txt?

No. `Noindex:` was never documented by Google and stopped working in September 2019 — use a noindex meta tag instead. `Host:` was a Yandex extension and is deprecated even there; state a preferred host with a canonical link or a redirect. Both are ignored by everything else, so a file relying on them is not doing what it appears to.

Is this generator free?

Yes. The builder, the raw editor, the validation, copy and download are free, with no account and no limit.

Is my robots.txt uploaded?

No. Everything runs locally in your browser — the file is generated, validated and downloaded on your own machine, and nothing you type is sent to our server. There is no account and nothing is stored.

Can I download the generated file?

Yes, as robots.txt with the correct name, ready to upload to the root of your site. You can also copy it to the clipboard, or switch to the raw editor and adjust it by hand first.

Can I edit the generated file by hand?

Yes — the Raw / edit tab hands you the text. Nothing is rewritten while you type, comments are preserved, and validation runs against exactly what is in the box. Switching back to the builder reads your text and rebuilds the form from it; that normalises spacing and hoists any trailing comment to the top, which the tab says before you do it.

Does robots.txt affect ranking?

Not directly — there is no ranking signal in it. Indirectly it matters a great deal, because a page that cannot be crawled cannot be ranked on its content, and a badly aimed Disallow can remove a whole section from consideration. Blocking crawl-wasting URLs such as faceted search can help by concentrating crawling on pages worth indexing.

Popular tools

↑ ↓NavigateOpenEscClose