Free tool ยท No sign-up

Robots.txt Generator

Build a clean robots.txt in minutes. Start from a template for your platform, add or remove rules, block AI crawlers with a click, list your sitemaps and test the result before you upload it.

  • Templates for WordPress, Shopify and more
  • Block AI crawlers in one click
  • Test every rule before you publish

Already have a file? Check it with the Robots.txt Tester.

From idea to live file

How to create and publish a robots.txt file

Robots.txt is a plain text file that sits at the root of your site. These four steps get a correct one live.

1

Pick a starting point

Choose the template closest to your site, or start from scratch. You can change everything afterwards.

2

Adjust the rules

Add the folders and URL patterns you don't want crawled, and list your sitemap. Use the Test tab to check real URLs.

3

Upload it to the root

Save it as robots.txt and put it at https://yoursite.com/robots.txt. It must be at the root of each host.

4

Re-test the live file

Open the Robots.txt Tester on your live site to confirm the right URLs are crawlable, then watch Search Console.

AI crawlers

AI crawlers: what each one does and what blocking it means

Not all AI user agents do the same job. Blocking the wrong one can remove you from AI search results while doing nothing about training.

Common AI crawlers, their owners and what blocking them affects
CrawlerOwnerPurposeBlocking it
GPTBotOpenAICollects content for training AI modelsKeeps your content out of future OpenAI training data
OAI-SearchBotOpenAIBuilds the index for ChatGPT searchCan stop your pages appearing in ChatGPT search results
ChatGPT-UserOpenAIFetches a page when a user asks ChatGPT toStops ChatGPT opening your pages on request
ClaudeBotAnthropicCollects content for training AI modelsKeeps your content out of future Anthropic training data
Google-ExtendedGoogleControl token for Gemini and Vertex AI use of your contentOpts out of Gemini training and grounding. Doesn't affect Google Search ranking
PerplexityBotPerplexityBuilds the Perplexity search indexCan stop your pages appearing in Perplexity answers
CCBotCommon CrawlBuilds an open dataset used to train many AI modelsKeeps you out of Common Crawl snapshots

Crawler names change over time. Check each company's documentation before relying on this list, and remember that obeying robots.txt is voluntary.

What to block and what not to

Robots.txt rules that help, and rules that hurt

A good robots.txt is short. Block what wastes crawl budget, and leave everything Google needs.

Block

Admin and login areas, cart and checkout pages, internal search results, endless filter and sort parameters, and staging sites.

Never block

CSS, JavaScript and images that your pages need to render, and any page you want in search results.

Don't use it to hide pages

Blocked pages can still be indexed. Use a noindex tag to keep a page out of results, and a login to keep it private.

Always list your sitemap

A Sitemap line is the easiest way to tell every crawler where your sitemap is, without a separate submission.

One file per host

Each subdomain and protocol needs its own robots.txt. The file on www doesn't cover blog.example.com.

Test after every change

One typo can block a whole section. Test the URLs that matter before and after you publish.

Why it matters

What a robots.txt generator does and why the file matters

A robots.txt file is a plain text file at the root of a website that tells crawlers which paths they may fetch. It is made of groups. Each group starts with a User-agent line that names a crawler (or * for all of them), followed by Allow and Disallow rules. You can also add Sitemap lines. The format is standardised in RFC 9309, and Google explains the parts it supports in its guide to creating a robots.txt file.

A generator helps because the syntax is simple to write and easy to get slightly wrong. One misplaced slash can block a whole section, and a file copied from another site may block folders your own site needs. This tool starts from a template for your platform, lets you add or remove rules, includes a switch for AI crawlers, and tests the result against real URLs before you upload anything.

Keep the limits in mind. A robots.txt file controls crawling, not indexing, and it is not security: the RFC says these rules are not a form of access authorization. Most sites need only a handful of lines, so a short and tested file is usually better than a long one.

When to use it

When to build a new robots.txt file

Write a fresh file at the moments when crawl rules are most likely to be missing or wrong.

Launching a new site

Draft a simple first file that allows crawling, lists your sitemap and blocks only admin or utility areas. Then check that no staging rule survived the move to production.

Replacing the WordPress default

WordPress builds a basic robots.txt on the fly. If you want to add a sitemap line, AI crawler rules or extra blocks, draft the full file here and publish it by the route your host supports.

Customising a Shopify store

Shopify generates a default file and lets you change it through a robots.txt.liquid template. Use the generator to work out which extra rules you want before you edit the template.

Choosing a position on AI crawlers

Decide whether to allow training crawlers, search crawlers, or both, and generate the right groups for each one instead of writing the names from memory.

Keeping crawlers out of low-value URLs

Block internal search results, cart and checkout pages, or endless filter and sort parameters so crawlers spend their requests on pages you want found.

Setting up a new subdomain or host

A robots.txt file only applies to the host, protocol and port it is served from. A new blog, shop or app subdomain needs its own file, not a copy of the main one.

Common mistakes

Robots.txt mistakes and how to avoid them

Most damaging robots.txt problems come from a rule that was right for one purpose and wrong for another.

Using it to hide pages from search

What goes wrong: A Disallow rule stops crawling, but a blocked URL can still be indexed if other pages link to it. And a blocked page cannot show Google a noindex tag, because Google never reads the page.

The fix: To keep a page out of results, leave it crawlable and add a noindex robots meta tag or X-Robots-Tag header. For private content, use a login.

Blocking CSS, JavaScript or images

What goes wrong: Rules such as Disallow: /wp-includes/ or a block on a theme or assets folder can stop Google from rendering your pages the way visitors see them.

The fix: Allow the files a page needs to render. Block only areas that are of no use to a searcher, such as admin screens, carts and internal search.

Carrying a staging block into production

What goes wrong: A Disallow: / copied from a staging server tells every crawler to stay away from the whole live site.

The fix: Read the file you are about to publish line by line, test your key pages against it, and check the live file again right after launch.

Putting the file in the wrong place

What goes wrong: A file in a folder, or only on www while the site also answers on another host, is ignored for the hosts it does not cover.

The fix: Serve it at the root of every host, for example https://example.com/robots.txt and https://blog.example.com/robots.txt, as plain UTF-8 text.

Blocking the wrong AI crawler

What goes wrong: Blocking OAI-SearchBot removes your site from ChatGPT search answers, even if your aim was only to opt out of AI training. Training and search use different crawlers, so one rule does not cover both goals.

The fix: Read each company's crawler documentation. OpenAI, for example, lists GPTBot for training and OAI-SearchBot for search, and says the two settings are independent.

Expecting Crawl-delay or Noindex to work in Google

What goes wrong: Google does not support the Crawl-delay directive, and it does not support noindex inside robots.txt. Lines like these look like controls but change nothing for Google.

The fix: Use a robots meta tag or header for noindex. Add Crawl-delay only for a specific crawler that documents support for it, for example Bing or Anthropic's crawlers, and check that crawler's documentation first.

Glossary

Robots.txt terms explained

User-agent
The line that starts a group and names the crawler the rules apply to. * means every crawler that has no group of its own.
Disallow
A rule that asks a crawler not to fetch URLs whose path starts with the given value. An empty Disallow blocks nothing.
Allow
A rule that permits a path, usually to make an exception inside a blocked folder. If rules conflict, Google applies the most specific one, and the less restrictive one on a tie.
Group
A User-agent line plus the rules under it. A crawler follows only the group that matches it most specifically, not every group in the file.
Wildcard (*) and $
* matches any run of characters and $ marks the end of the URL. For example, Disallow: /*.pdf$ matches URLs that end in .pdf. Paths are case-sensitive.
Sitemap directive
A Sitemap: line with a full URL that tells crawlers where your sitemap is. It sits outside the groups and applies to every crawler.
Crawl-delay
A non-standard directive that asks a crawler to wait between requests. Google ignores it. Some other crawlers honour it.
X-Robots-Tag
An HTTP response header that carries indexing rules such as noindex. It works for files like PDFs, where a meta tag is not possible, and the page must be crawlable for it to be read.
Madhav Kushwaha, SEO, AEO, GEO and digital marketing consultant in Kathmandu, Nepal

Built by

Madhav Kushwaha

SEO, AEO, GEO & Digital Marketing Consultant in Kathmandu, Nepal, and trainer at ODcrU Academy and TechAxis Institute. I built this generator because most robots.txt files on the web are copied from somewhere else and never tested. Every template here is a starting point I would be comfortable handing to a client, and the built-in tester uses Google's matching rules.

Robots.txt Generator: Frequently Asked Questions

Robots.txt is a plain text file at the root of a website that tells crawlers which parts of the site they may or may not crawl. It is read before a crawler fetches other pages. It controls crawling, not indexing.
At the root of the host, so that it is reachable at https://yoursite.com/robots.txt. A file inside a folder is ignored. Each subdomain, such as blog.yoursite.com, needs its own file.
Add a group for each crawler with a Disallow: / rule. In this generator, open the Block AI and SEO crawlers section and tick the crawlers you want to block. Blocking is a request: the major AI companies say they honor it, but it isn't enforced.
No. Google-Extended is a control token for whether Google may use your content for Gemini and Vertex AI. It doesn't change how Google Search crawls, indexes or ranks your site.
No. Google renders pages with your CSS and JavaScript. If they are blocked, it may not see your layout or content correctly, which can hurt mobile-friendliness and rankings.
Disallow tells a crawler not to fetch a path. Allow carves out an exception inside a blocked area, for example Disallow: /private/ with Allow: /private/press-kit/. The longest matching rule wins, and Allow wins a tie.
Google ignores Crawl-delay. Bing, Yandex and a few other crawlers honor it. Only add it if a particular crawler is overloading your server, and set it for that crawler only.
No. It stops crawling, but a blocked URL can still be indexed from links on other sites. To remove or prevent indexing, use a noindex robots meta tag or X-Robots-Tag header on a crawlable page, or the removals tool in Search Console.
Add a line such as Sitemap: https://yoursite.com/sitemap.xml with the full URL. You can list several sitemaps. It can sit anywhere in the file and applies to every crawler.
It is free with no sign-up. Everything is built in your browser and nothing is stored or sent to a server.

More free SEO tools

Crawling and indexing are connected: use these tools together to keep search engines pointed at the right pages.

Call WhatsApp SEO Audit