Robots.txt Generator

Generates a robots.txt for your site — which crawlers may fetch what, and where your sitemap lives. A small file with an outsized ability to remove a site from search if it is wrong.

Live demo · real result from this tool
Default for all crawlers

robots.txt

# robots.txt — must be served at the site root (https://example.com/robots.txt)# It asks crawlers not to fetch paths; it does not hide or de-index them. User-agent: *Disallow: /cart/Disallow: /search Sitemap: https://example.com/sitemap.xml 

Disallow stops crawling, not indexing: to remove a page from search, allow crawling and serve a noindex meta tag or X-Robots-Tag header.

Processed on your device — nothing is uploaded.

How to use Robots.txt Generator

  1. Choose which crawlers to allow or block.
  2. Add any paths to disallow — and check none of them are pages you want indexed.
  3. Include your full sitemap URL.
  4. Save it at the site root, at /robots.txt, and fetch it in a browser to confirm it serves.
  5. It must live at the root of the domain; a subdirectory location is ignored entirely.
  6. Each subdomain needs its own file — one on the apex domain does not cover them.
  7. Disallow prevents crawling, never indexing; use a noindex tag to remove a page from results.

Disallow is not noindex, and this trips up everyone

robots.txt controls crawling, not indexing. A page you disallow can still appear in search results — typically with no description, because Google was told not to read it but found it linked elsewhere. Worse, if you disallow a page you also want de-indexed, the crawler cannot see your noindex tag, so the page stays indexed indefinitely. To remove a page: let it be crawled and serve a noindex meta tag or header. To save crawl budget on pages already out of the index: disallow.

The rule that takes a site offline

User-agent: * followed by Disallow: / blocks everything. It is the correct content for a staging site and catastrophic on production, and it has repeatedly gone live during a deploy when the staging file was copied across. If organic traffic disappears overnight, this is the first file to check. Note that a blank Disallow value means allow everything, which is the opposite of what it looks like.

What it cannot do

It is a request, not an access control. Well-behaved crawlers honour it; malicious scrapers and email harvesters ignore it entirely. Worse, robots.txt is public, so listing /admin/ or /private-backups/ as disallowed advertises exactly where the interesting directories are. Never put anything in it that you would not want a stranger to read as a map. Protect sensitive paths with authentication.

Crawlers worth naming explicitly

Googlebot and Bingbot for search. GPTBot, ClaudeBot, CCBot, PerplexityBot and Google-Extended for AI training and retrieval — each honours robots.txt and each has its own token, so blocking AI crawlers while allowing search is a deliberate and common choice worth making consciously rather than by default. Also include the full sitemap URL, which is the one line in robots.txt that actively helps discovery rather than restricting it.

Frequently asked questions

Does this block a page from Google entirely?
Disallow in robots.txt only stops crawling — a previously indexed page can still appear in search results. Use a noindex meta tag to remove it from the index.
Can I use this file directly on my live site?
Yes, as a starting point — double-check paths, URLs, and directives against your actual domain before deploying.
Does this tool call any external API to generate the file?
No. Everything is built client-side in your browser from the values you enter.
Will robots.txt remove a page from Google?
No, and this is the most common misunderstanding. It stops crawling, so a disallowed page can still be indexed from external links — and because the crawler cannot read the page, it will never see a noindex tag. Allow crawling and serve noindex instead.
Where does robots.txt go?
At the root of each domain or subdomain: example.com/robots.txt. A file anywhere else is ignored, and a file on the apex domain does not apply to shop.example.com, which needs its own.
Should I block AI crawlers?
It is a genuine choice rather than a default. GPTBot, ClaudeBot, CCBot, PerplexityBot and Google-Extended all honour robots.txt and can be named individually, so you can block training while allowing search indexing. Decide deliberately — some of these crawlers also drive referral traffic.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close