robots.txt Generator
Build a robots.txt file without memorising the syntax. Choose which user agents the rules apply to, list the paths to allow or to block, set a crawl delay and point the search engines at your sitemap, then upload the result at the root of your domain.
Input
robots.txt
Ready — paste some input or load the sample.
100% Client-Side · Privacy First. This tool runs entirely inside your browser. Nothing you type is uploaded, logged or sent to a server — you can even use it offline.
Overview
robots.txt is the first thing a crawler reads, and it does exactly two things: it tells crawlers which paths they may not fetch, and it points them at the sitemap. It does not protect anything, it does not remove a page from the index, and it is not a firewall. Those distinctions matter, because the most common mistake is to use it to hide a page that should not be indexed and then wonder why the page still appears in the search results. A path that is disallowed can still be indexed as a link without a description. The generator produces a standards compliant file with the user agent blocks, the disallow and allow rules, an optional crawl delay and the sitemap line. It also writes the empty Disallow line, which is the correct way to say that everything is permitted, and it reminds you in the notes that the most specific rule wins.
How to use the robots.txt generator
- 1List the user agents the rules apply to, or leave the default wildcard.
- 2Add the paths to disallow and, where you need one, the paths to allow.
- 3Set a crawl delay if the server cannot take more traffic than you want.
- 4Paste the sitemap URL so the crawlers can find your pages.
- 5Upload the file as robots.txt in the root of your domain and check it from the browser.
- 6Remember that robots.txt controls crawling, not indexing: a blocked URL can still show up in a search result.
Cheat sheet
The syntax you will use most, and what each part does.
| Pattern | What it means |
|---|---|
User-agent: * |
The wildcard group that applies to every crawler that has no group of its own. |
Disallow: |
An empty value allows everything. It is the standard line in a robots.txt with no restrictions. |
Disallow: /admin/ |
Blocks a directory and everything under it. |
Allow: /public/ |
Re-opens a path inside a blocked directory, because the most specific rule wins. |
Sitemap: https://x.dev/sitemap.xml |
The absolute URL of the sitemap, which is how crawlers find pages on a large site. |
Crawl-delay: 10 |
A politeness delay in seconds. Google ignores it, but other crawlers honour it. |
Common mistakes
A blocked page still appears in the index.
robots.txt stops crawling, not indexing. A page linked from elsewhere can still be indexed without its content, and the fix is a noindex meta tag or an X-Robots-Tag header.
The whole site disappears from the search results.
Check for a Disallow: / line. That blocks everything, and it is the single most damaging line you can add by accident.
An Allow rule has no effect.
The most specific path wins, not the Allow rule. A Disallow: / with an Allow: /public/ works; the other way round does not.
The file is not found.
It has to sit at the root of the domain, in lowercase, and be served as plain text. A page under a subdirectory is never read.
Worked examples
A simple private area
host: tools.cesarcai.dev userAgents: * disallow: /admin/, /private/ sitemap: https://tools.cesarcai.dev/sitemap.xml
A robots.txt with a wildcard group, two blocked paths and the sitemap line.
Allow everything
userAgents: * sitemap: https://tools.cesarcai.dev/sitemap.xml
A file with the empty Disallow line, which is the correct way to permit every crawler.
Frequently asked questions
Should I disallow the whole site while I build it?
Only if you really want the site out of the index, and remember that a disallow does not remove a page that is already indexed. Use a noindex header or a password for a staging site instead.
Does robots.txt protect private files?
No. It is a public file that every crawler can read, and it is a request rather than a lock. Anything that must stay private needs real authentication.
Where does the file go?
In the root of your domain, so it is reachable at https://example.com/robots.txt. A file in a subdirectory is ignored by every crawler.
Do I need one at all?
A small site does not need it, but it costs nothing and it is the place to advertise your sitemap. If your host already serves one, edit that one instead of adding a second.
Which rule wins when an Allow and a Disallow overlap?
The most specific one wins. A rule for /blog/ therefore overrides a rule for the whole site, which is the standard way to hide a section while keeping one part of it crawlable.
Does an empty Disallow line block the site?
No, it means nothing is disallowed, so everything is allowed. A blocking rule needs an actual path after the colon.
Is a crawl delay respected?
Google ignores it, and most other crawlers honour it only loosely. Treat it as a request rather than a guarantee, and throttle at the server instead if you need a hard limit.
Can I list several user agents?
Yes. Separate them with commas and the generator writes one block per agent, each with its own rules, which is how you can block one crawler while leaving the others alone.
Does the file affect the ranking of the pages it allows?
No, robots.txt controls crawling rather than ranking. A page that is allowed to be crawled but is thin, slow or badly linked still ranks badly.
Can I use a wildcard in a path?
Most crawlers support the asterisk and the dollar sign at the end of a path, so /admin/ blocks a whole section and a trailing dollar sign matches exactly.
How often do the crawlers read the file?
Google caches it for weeks, and other crawlers cache it for their own intervals. Expect a change to take days rather than minutes to take effect.