Robots.txt Generator
By Digital Mansoor, 14+ years in SEO. Updated November 2026.
Pick what to block, add your sitemap, copy the file. Includes an option to block common AI training bots.
- Free, no signup
- Runs in your browser
- 4 presets
- 5 AI bot switches
Rate this tool
Rated 5 / 5 from 1 user rating. Click a star to add yours.
What is the Robots.txt Generator?
It writes a robots.txt file from a few choices: a starting preset, extra paths to block, your sitemap URL and the AI crawlers you want to turn away.
A robots.txt file is a short text file that sits at the root of a website. Before a well-behaved crawler requests your pages, it reads this file to see which paths are off limits. A missing line can leave a cart or admin area open to crawling. A wrong line can block a whole site.
The generator removes the typing. You choose a preset, add paths one per line, paste a sitemap URL and tick the AI bots you do not want. The file appears as you go, with the groups, blank lines and directives in the order crawlers expect. You copy it, save it as robots.txt and upload it to your site root.
It suits site owners launching a WordPress site, store owners who want carts and checkout kept out of crawls, developers protecting a staging site, and SEO consultants who write the same file for many clients. I am Mansoor, an SEO consultant working since 2012. The tool is free, needs no signup and runs in your browser.
- Builds a robots.txt from a preset, extra paths, a sitemap URL and bot choices.
- Can block GPTBot, ClaudeBot, CCBot, PerplexityBot and Google-Extended.
- Writes Crawl-delay only when you set a value above 0.
- Free, no signup, and nothing leaves your browser.
Built by Mansoor BhanpurawalaSEO consultant since 2012. About Digital Mansoor
How to use the free Robots.txt Generator
- Pick a starting presetChoose allow everything, WordPress, online store or block everything. The preview on the right changes as soon as you pick one.
- Add extra pathsType one path per line, each starting with a slash, such as /internal-search/. The tool adds them as Disallow lines in the main group.
- Paste your sitemap URLUse the full address, including https. It becomes a Sitemap line at the end of the file. Leave it empty and no line is written.
- Choose the AI crawlers to blockTick GPTBot, ClaudeBot, CCBot, PerplexityBot or Google-Extended. Each one gets its own group with Disallow: /.
- Set a crawl delay only if you need oneLeave it at 0 to omit the line. Googlebot ignores Crawl-delay. Bing and some other crawlers read it.
- Copy, upload and testSave the text as robots.txt, upload it to your site root so it loads at /robots.txt, then run it through the Robots.txt Checker.
Settings reference
| Setting | Options | What it writes |
|---|---|---|
| Preset: allow everything | One choice | User-agent: * and an empty Disallow |
| Preset: WordPress | One choice | Disallow /wp-admin/ and Allow /wp-admin/admin-ajax.php |
| Preset: online store | One choice | Disallow /cart/, /checkout/, /my-account/ and /*?add-to-cart= |
| Preset: block everything | One choice | Disallow: / for all crawlers |
| Extra paths | One per line | More Disallow lines in the main group |
| Sitemap URL | Full URL, optional | A Sitemap line at the end |
| AI crawlers | 5 switches | A separate group with Disallow: / for each |
| Crawl delay | 0 means off | Crawl-delay in the main group |
Presets are starting points. Check every path against your own site before you upload.
Examples: settings in, robots.txt out
Three real outputs from the tool, generated on 12 November 2026. Replace example.com with your own domain.
WordPress site, three AI bots blocked
14 lines. Preset WordPress, sitemap added, GPTBot, ClaudeBot and CCBot ticked.
User-agent: * Disallow: /wp-admin/ Allow: /wp-admin/admin-ajax.php User-agent: GPTBot Disallow: / User-agent: ClaudeBot Disallow: / User-agent: CCBot Disallow: / Sitemap: https://example.com/sitemap_index.xml
Online store with a crawl delay
12 lines. Preset online store, one extra path, delay 10, Google-Extended ticked.
User-agent: * Disallow: /cart/ Disallow: /checkout/ Disallow: /my-account/ Disallow: /*?add-to-cart= Disallow: /internal-search/ Crawl-delay: 10 User-agent: Google-Extended Disallow: / Sitemap: https://example.com/sitemap.xml
Staging site
2 lines. Preset block everything, nothing else ticked.
User-agent: * Disallow: /
Add a password to a staging site as well. Robots.txt is public, compliant crawlers only follow it by choice, and a blocked URL can still be indexed if other pages link to it.
The store example blocks add-to-cart URLs with a wildcard. The * matches any run of characters, so every URL containing that parameter is covered. Google reads * and $ in paths, and paths are case sensitive.
How crawlers read your robots.txt
The generator follows the rules Google documents for its own crawlers. These are the ones that decide whether your file does what you expect.
| Rule | What Google does | What it means for your file |
|---|---|---|
| Supported fields | Reads user-agent, allow, disallow and sitemap. Ignores others, including crawl-delay. | A Crawl-delay line never slows Googlebot. |
| Conflicting rules | The longest matching path wins. On a tie, the less restrictive rule wins, so Allow beats Disallow. | You can block a folder and still allow one file inside it. |
| Group choice | A crawler uses only the one group that matches its name most closely. Groups are not merged with the * group. | A bot group such as GPTBot does not inherit your * rules. Each group stands alone. |
| Wildcards | * matches any characters, and $ marks the end of a URL. Paths are case sensitive. | /Photos/ and /photos/ are different paths. |
| Size | Reads the first 500 KiB and ignores the rest. | Rules placed after the limit never apply. |
| Caching | Caches the file for up to 24 hours. | A change can take a day to reach Googlebot. |
| Errors | A 4xx response, except 429, means no restrictions. A 5xx stops crawling for about 12 hours, then a cached copy is used for up to 30 days. | A broken file can open up your site or pause crawling. |
| Location | One file per host, protocol and port, at the top-level directory. | Subdomains need their own robots.txt. |
Source: Google Search Central, how Google interprets the robots.txt specification. Other search engines can behave differently, so test each one that matters to you.
Where a generated robots.txt helps
The right file depends on what you want crawlers to skip. These are the situations the presets and switches were built around.
Each case below keeps to one rule of thumb: block crawling of pages that waste crawler time or that you do not want requested, and never block files a page needs to render.
WordPress site owners
Keep /wp-admin/ out of crawls while leaving admin-ajax.php reachable, which some themes and plugins call from public pages.
Online store owners
Stop crawlers from requesting cart, checkout, account and add-to-cart URLs that have no search value.
Developers with a staging site
Ask crawlers to stay away with one Disallow line. Add a password too, because robots.txt is a request and the file is public.
Publishers opting out of AI training
Turn off the training crawlers you object to with one tick each, and keep search crawlers allowed.
SEO consultants and agencies
Produce a clean baseline file for a client, then refine it after the Robots.txt Checker run.
Robots.txt Generator compared with other ways to write the file
I compared this tool with the robots.txt generator on elementor.com, read from its page on 22 October 2026, and with writing the file by hand.
| Check | This tool | elementor.com | By hand |
|---|---|---|---|
| Presets | WordPress, store, allow all, block all | Pre-filled WordPress paths | You type every line |
| AI bot options | Five switches: GPTBot, ClaudeBot, CCBot, PerplexityBot, Google-Extended | Not mentioned on the page | You look up each token |
| Sitemap field | Yes | Yes | You type it |
| Crawl delay | Yes, 0 turns it off | Yes, 5 to 120 seconds | You type it |
| Per-bot rules | AI bot switches only | Search robot overrides | Any rule you can write |
| Signup | None | Not stated | None |
Where they are ahead: elementor.com lets you set rules for individual search robots such as Google or Ahrefs, and writing by hand has no limits. This tool covers AI bots with toggles instead. Features can change, so check each page before you rely on this table.
Why generate the file instead of typing it
Fewer syntax slips
Every group starts with its own User-agent line and is separated by a blank line. A missing colon or a stray character is easy to miss in a hand-typed file, and a crawler may read it differently from what you meant.
Bot names spelled the way vendors list them
The switches use the tokens GPTBot, ClaudeBot, CCBot, PerplexityBot and Google-Extended. You do not have to look up each spelling or remember which ones need their own group.
A safe starting point
The WordPress and store presets block the usual low-value paths and keep admin-ajax.php reachable. You start from a working file and adjust, instead of from a blank page.
Private by design
The file is built in your browser. Your paths and sitemap URL are not sent to this site or any other server.
Robots.txt terms in plain language
robots.txt
A plain text file at the root of a host that lists crawling rules for bots.
User-agent
The line that names the crawler a group of rules applies to. * means all crawlers.
Disallow
A path the named crawler should not request. An empty value blocks nothing.
Allow
A path the crawler may request, often used to open one file inside a blocked folder.
Sitemap
A line that gives the full URL of an XML sitemap. It does not belong to any one group.
Crawl-delay
A request to wait between fetches. Google ignores it. Bing and some others read it.
Wildcard
The * character, which matches any run of characters, and $, which marks the end of a URL.
Crawler
A program that fetches web pages, also called a bot or spider.
Group
One User-agent line plus the rules under it. A crawler follows only its best matching group.
noindex
A page-level rule that keeps a page out of search results. It is separate from robots.txt.
GPTBot
OpenAI’s crawler used to gather content for model training.
Google-Extended
A robots.txt token that controls some Google AI uses of your content. It does not affect Search crawling.
What the Robots.txt Generator cannot do
- Blocking AI bots only works for crawlers that respect robots.txt. It is a request, not enforcement.
- Robots.txt is public and is not security. Anyone can read it, so do not list private paths you want hidden.
- It does not remove pages already indexed.
- It does not cover user-triggered fetchers such as ChatGPT-User or Perplexity-User, which their vendors say may ignore robots.txt.
- Do not block CSS or JavaScript that pages need to render.
Is my text or data sent anywhere?
Your input is processed in your browser and is not sent to this site or any other server. The Save button keeps snapshots in your own browser storage. The share link puts your input in the part of the URL after the # sign, which browsers do not send to servers, but anyone you give the link to can read it.
How this tool was built and checked
Last reviewed 12 November 2026 by Mansoor Bhanpurawala, SEO consultant since 2012.
Sources
- Google Search Central: how Google interprets the robots.txt specification, for the rules in the table above.
- RFC 9309, the Robots Exclusion Protocol standard.
- Vendor bot documentation, including OpenAI and Perplexity, for bot names and purposes.
- The output examples on this page come from the live tool, not from a mockup.
Update policy and limits
- I recheck the bot list and Google behavior when a vendor changes its documentation, and at least once a quarter.
- The Google rules were read from Google’s own documentation. Bot purposes were checked against vendor documentation and third-party summaries, so confirm them with each vendor before you depend on a rule.
- The tool writes only the directives listed above. It does not validate your live file. Use the Robots.txt Checker for that.
More free tools you may need
Robots.txt Generator FAQ
Short answers on robots.txt rules, AI crawlers and using this tool.
What is a robots.txt file?
A robots.txt file is a plain text file at the root of a website. It tells crawlers which URLs they may request, and well-behaved crawlers read it before they fetch pages. It controls crawling, not indexing. It is public, so anyone can read it at yourdomain.com/robots.txt.
Where do I put robots.txt?
Put it in the top-level directory of the host so it loads at yourdomain.com/robots.txt. Google does not look for the file in subfolders. Each host, protocol and port needs its own file, so a subdomain such as blog.yourdomain.com needs a separate robots.txt.
How do I create a robots.txt file?
Write it by hand in a text editor, or build it with this generator. Pick a preset, add extra paths, paste your sitemap URL and choose which AI crawlers to block. Copy the result into a file named robots.txt, upload it to your site root, and test it in the Robots.txt Checker first.
Is the Robots.txt Generator free, and does it store my data?
Yes, it is free and needs no signup. It builds the file in your browser, so your paths and sitemap URL are not sent to this site. The Save button keeps snapshots in your own browser storage, and the share link puts your input after the # sign in the URL.
Does this generator use AI?
No. It assembles the file from fixed presets and the options you choose. The same input gives the same file every time.
Can I block ChatGPT with robots.txt?
You can block OpenAI’s GPTBot training crawler, and the tool has a switch for it. OpenAI also runs other agents, such as OAI-SearchBot and ChatGPT-User, that need their own lines. User-triggered fetchers may not follow robots.txt at all, so treat the file as a request and not as enforcement.
Does blocking Google-Extended hurt my Google rankings?
No. Google-Extended is a robots.txt token that controls whether your content is used for some Google AI uses. It does not change how Googlebot crawls or ranks your pages for Search. It has no user-agent string of its own, so it never appears in server logs.
Does blocking AI bots in robots.txt actually work?
It works for crawlers that respect the file, and most major vendors document their named bots as doing so. Robots.txt is a convention, not a lock. A crawler that ignores it can still fetch your pages, so use firewall or CDN rules if you need enforcement.
Does Google support crawl-delay?
No. Google supports user-agent, allow, disallow and sitemap, and ignores crawl-delay. Bing and some other crawlers read it. The tool writes the line inside the main group and leaves it out when you set the delay to 0.
Should I add a sitemap to robots.txt?
Yes. A Sitemap line helps crawlers find your sitemap and works regardless of which user-agent group it sits near. Use the full URL with https. If you leave the field empty, the tool writes no Sitemap line.
What is the robots.txt size limit?
Google reads up to 500 KiB and ignores anything after that, so rules past the limit never apply. If a file grows too large, consolidate rules with broader paths. Files built with this tool are usually a few lines long.
Which rule wins when Allow and Disallow conflict?
The most specific rule wins, meaning the one with the longest matching path. If two rules are equally specific, Google uses the less restrictive one, so Allow beats Disallow. That is why the WordPress preset can block /wp-admin/ and still allow /wp-admin/admin-ajax.php.
Is robots.txt case sensitive?
Paths in rules are case sensitive, so Disallow: /Photos/ does not block /photos/. Field names such as User-agent and Disallow are not case sensitive. The file name itself must be lowercase robots.txt.
Does robots.txt remove a page from Google?
No. It stops compliant crawlers from fetching a URL, but a blocked URL can still be indexed if other pages link to it, and a page already in the index stays there. To keep a page out of results, let it be crawled and use a noindex rule, or use the removal tools.
What happens if my robots.txt is missing or returns an error?
A 4xx response, other than 429, is treated as no robots.txt, so Google assumes nothing is blocked. A 5xx response makes Google stop crawling the site for about 12 hours while it keeps retrying, then it uses a cached copy for up to 30 days. Redirects are followed for up to five hops.
Should I use robots.txt or noindex?
Use robots.txt to control crawling, for example to keep crawlers out of cart pages, internal search or admin areas. Use noindex to keep a page out of search results. Do not combine them on one URL, because a page blocked in robots.txt cannot show its noindex tag to the crawler.
Want this done for your site?
Send your URL on WhatsApp and I will tell you what to fix first.
Message me on WhatsAppNeed more than a free tool? See my technical SEO consulting and on-page SEO consulting work.
Need more than a free tool?
See my freelance SEO consulting and SEO for small business work.

Leave a Reply