robots.txt generator
Build a robots.txt file for one crawler group, with the rules that look sensible and are not flagged.
A crawler obeys the most specific group that names it, and ignores every other group.
One path per row, each starting with a slash. These are paths, not full URLs.
Re-permits something inside a disallowed folder, e.g. /admin/public/.
Absolute, always. Sitemap lines sit outside the groups and apply to every crawler.
Google ignores this. Bing and Yandex honour it. Leave empty unless a crawler is hurting your server.
robots.txt
User-agent: *
Disallow: /admin/Before you ship this
- Note: No Sitemap line. It is not required, but it is the cheapest way to tell a crawler what exists.
- Note: Disallow stops crawling, not indexing. A blocked URL that other pages link to can still appear in results, with no description. To remove a page, let it be crawled and serve noindex.
How to use it
- Pick who the rules apply to. A crawler obeys the most specific group that names it and ignores every other group.
- Add the paths to disallow, one per row, each starting with a slash. These are paths, not full URLs.
- Add any exceptions you need — an Allow line re-permits something inside a disallowed folder.
- Add your sitemap URL as an absolute address, then copy the file to the root of your domain as /robots.txt.
robots.txt is a crawl budget tool, not a privacy one
The file does exactly one thing well: it stops well-behaved crawlers wasting requests on parts of your site that have nothing to index. Faceted search with a thousand filter combinations, internal search results, a staging mirror, print versions — those are what Disallow is for.
It does not hide anything. The file is public, it is the first thing anyone looks at, and every path in it is a signpost. If a URL must not be seen, it needs a login, not a line in a text file that advertises its existence.
Blocked and deindexed are different things
This catches people constantly. A disallowed page is not crawled, so Google never reads the noindex tag you put on it, so the page stays in the index — and because the content was never fetched, it appears with no description at all.
The sequence that actually removes a page is the opposite of what it feels like it should be: allow the crawl, serve noindex, wait for it to drop out, and only then block the path if you want to save the crawl requests.
How a crawler picks its group
A crawler reads the whole file, finds the group whose User-agent line names it most specifically, and obeys only that group. It does not merge groups. So a Googlebot group that omits a rule present in your * group means Googlebot does not follow that rule.
Sitemap lines are the exception: they sit outside the groups and apply to every crawler, which is why they belong after a blank line at the end rather than inside a group.
Ordering, and what wins
Google resolves conflicts by specificity — the longest matching path wins, and a tie goes to the least restrictive rule. That means an Allow and a Disallow for the same path leaves the path allowed, and the Disallow does nothing at all.
robots.txt generator FAQ
Does robots.txt remove a page from Google?
No. Disallow stops crawling, not indexing. A blocked URL that other pages link to can still appear in search results, usually with no description. To remove a page, let Google crawl it and serve a noindex tag — which it cannot see if the page is blocked.
Can I use robots.txt to hide a private area?
No, and it makes things worse. robots.txt is a public file at a predictable address, so every path you list there is published to anyone curious enough to read it. Use authentication. A password-protected area needs no robots.txt entry at all.
How do I block ChatGPT and other AI crawlers?
Add a group for GPTBot, ClaudeBot, Google-Extended or CCBot and disallow what you want kept out. These crawlers honour robots.txt as a matter of their operators’ stated policy, not because anything forces them to, so treat it as a request that the major ones currently respect.
Does Google respect Crawl-delay?
No. Googlebot ignores it entirely. Bing and Yandex honour it. If Googlebot is hitting your server too hard, set the crawl rate in Search Console, or return 429 and 503 responses, which it does respond to.
Where exactly does the file go?
At the root of each host and protocol: the file at example.com covers nothing on shop.example.com, which needs its own. A robots.txt in a subdirectory is ignored entirely, which is a surprisingly common way to leave a site with no rules at all.
Are the rules case-sensitive?
The paths are, the user-agent names are not. Disallowing /Admin/ does nothing about /admin/, and on a server that serves both, you have blocked one and left the other open. Match the case your URLs actually use.
How do wildcards work?
Google and most major crawlers support an asterisk for any sequence of characters and a dollar sign to anchor the end of a URL, so you can block every PDF with a single rule. Neither is in the original specification, so smaller crawlers may not honour them.
Can I list more than one sitemap?
Yes, as many Sitemap lines as you need, each with an absolute URL. They sit outside the user-agent groups and apply to every crawler. For a large site, point at a sitemap index rather than listing fifty files individually.
Is there a size limit?
Google parses the first 500 kibibytes and ignores the rest, which is a great deal of rules but not infinite. A file approaching that size is almost always generated from a list of individual URLs, which is the wrong tool — pattern rules or noindex tags will serve better.
What happens if robots.txt returns an error?
It matters more than people expect. A 404 is treated as no restrictions, which is safe. A 500 or a timeout is treated as a signal to stop crawling the site, and if it persists Google may drop pages. A robots.txt served by an application that can fail is a risk worth removing.