Robots.txt Generator

Create a robots.txt file in seconds. Set rules for search engines and AI crawlers like GPTBot and ClaudeBot, add your sitemap, then copy or download the file.

Default rule for all crawlers

Applies to Googlebot, Bingbot and every crawler you don’t list below.

One per line, starting with /. Leave empty to allow everything.

Quick add:

Paths inside a blocked folder that crawlers should still reach.

AI crawlers

Each group is separate. Blocking training crawlers doesn’t remove you from AI search answers.

  • AI training crawlers

    GPTBot, ClaudeBot, Google-Extended, Applebot-Extended, Meta-ExternalAgent, CCBot, Bytespider

  • AI search crawlers

    OAI-SearchBot, Claude-SearchBot, PerplexityBot

  • User-triggered fetchers

    ChatGPT-User, Claude-User, Perplexity-User

Full URL. Add one per line if you have several.

robots.txt

User-agent: *
Allow: /

How to use the robots.txt generator

1. Pick a default rule

“Allow all” lets every crawler reach every page, which is right for most live sites. “Block all” adds Disallow: / for every crawler. Only use it on staging or private sites, because it blocks Googlebot too.

2. Block the paths you don’t want crawled

Add one path per line, starting with a slash. Good candidates are pages with no search value: admin areas, cart and checkout steps, account pages, internal search results and sort or filter URLs. The quick-add buttons fill in the common ones.

3. Decide what AI crawlers can do

AI bots fall into three groups, and you can treat each one differently. A common setup is to block the training crawlers and allow the search crawlers. Your content stays out of model training but can still be cited in ChatGPT search, Claude and Perplexity answers.

4. Add your sitemap

Paste the full URL of your XML sitemap. Any crawler that reads robots.txt can find it there, including Bing and the AI search bots, which never see the sitemaps you submit in Google Search Console.

5. Upload the file to your root folder

Download the file and upload it to the root of your domain so it loads at https://yourdomain.com/robots.txt. Then open the robots.txt report in Search Console to confirm Google can fetch it.

What is a robots.txt file?

A robots.txt file is a plain text file at the root of your site that tells crawlers which URLs they may request. Search engines and most AI companies check it before they crawl. A simple one looks like this:

User-agent: *
Disallow: /admin/

Sitemap: https://example.com/sitemap.xml

Where robots.txt has to live

It only works at the root of a host, like https://example.com/robots.txt. A file in a subfolder is ignored. Each subdomain needs its own file, so blog.example.com doesn’t follow the rules on example.com.

What robots.txt can’t do

  • It doesn’t remove pages from Google. A blocked URL can still be indexed if other pages link to it; Google just can’t read its content. Use a noindex tag to keep a page out of search.
  • It isn’t security. The file is public, so listing a private folder points people straight to it. Protect private pages with a login.
  • It’s a request, not a lock. Reputable crawlers follow it. Scrapers and badly behaved bots may not.

Robots.txt directives explained

User-agent

Names the crawler a group of rules applies to, and * means every crawler. A crawler follows only the most specific group that matches it. Once you add a group for GPTBot, GPTBot ignores your * rules, so that group needs every rule you want it to follow.

Disallow

Tells the crawler not to request URLs that start with the path. Disallow: /cart/ blocks /cart/ and everything under it. An empty Disallow: blocks nothing.

Allow

Makes an exception inside a blocked folder. Google and Bing apply the most specific matching rule, so Allow: /wp-admin/admin-ajax.php wins over Disallow: /wp-admin/.

Sitemap

Points crawlers to your XML sitemap. It must be a full URL, you can list more than one, and it isn’t tied to any user-agent group.

Wildcards: * and $

* matches any run of characters and $ marks the end of a URL. Disallow: /*?sort= blocks any URL with a sort parameter, and Disallow: /*.pdf$ blocks URLs ending in .pdf. Paths are case-sensitive, so /Admin/ and /admin/ are different rules.

Crawl-delay

Asks a crawler to wait between requests. Google ignores it. Bing supports it, and Anthropic says its bots respect it as well.

Should you block AI crawlers?

It depends on what you want from AI tools. The bots fall into three groups, and blocking one group doesn’t affect the others.

AI training crawlers

These collect content that may be used to train AI models. Blocking them tells the company to leave your content out of future training data. It doesn’t remove you from AI search answers. Google-Extended and Applebot-Extended aren’t separate crawlers: they’re tokens that control how Google and Apple use what their normal crawlers collect. Blocking Google-Extended doesn’t affect Google Search or AI Overviews.

AI search crawlers

These index pages so AI assistants can find and cite them. OpenAI says sites that block OAI-SearchBot won’t be shown in ChatGPT search answers, and Anthropic says blocking Claude-SearchBot may reduce your visibility in Claude’s results. If you want to show up in AI answers, keep these allowed.

User-triggered fetchers

These visit a page when someone asks an assistant about it, for example by pasting your URL into ChatGPT. OpenAI and Perplexity say robots.txt rules may not apply to these requests because a person started them. Anthropic says Claude-User does follow robots.txt.

These are all the AI crawlers the generator covers:

User-agentCompanyGroup
GPTBotOpenAIAI training crawlers
ClaudeBotAnthropicAI training crawlers
Google-ExtendedGoogleAI training crawlers
Applebot-ExtendedAppleAI training crawlers
Meta-ExternalAgentMetaAI training crawlers
CCBotCommon CrawlAI training crawlers
BytespiderByteDanceAI training crawlers
OAI-SearchBotOpenAIAI search crawlers
Claude-SearchBotAnthropicAI search crawlers
PerplexityBotPerplexityAI search crawlers
ChatGPT-UserOpenAIUser-triggered fetchers
Claude-UserAnthropicUser-triggered fetchers
Perplexity-UserPerplexityUser-triggered fetchers

Common robots.txt mistakes

Blocking CSS and JavaScript

Google renders pages the way a browser does. If robots.txt blocks your CSS or JavaScript, Google may see a broken page. Leave asset folders crawlable.

Blocking a page you want removed from Google

If a page has a noindex tag and is also blocked in robots.txt, Google can’t crawl it to see the tag, so the URL can stay indexed. Let Google crawl it until it drops out of search, then block it if you need to.

Launching with the staging file

Staging sites often block every crawler with Disallow: /. If that file goes live with the launch, Google stops crawling the whole site. Check robots.txt as part of every launch checklist.

Blocking AI search bots by accident

Many “block AI” snippets copied from the web block every AI bot, search crawlers included. That takes you out of ChatGPT search and Perplexity answers too, which is rarely the goal. Block by group instead.

Frequently asked questions

Do I need a robots.txt file?

No. Without one, crawlers assume they can crawl everything. It's still worth having one to point crawlers to your sitemap and keep them away from pages with no search value.

How long does Google take to see changes to robots.txt?

Google generally caches robots.txt for up to 24 hours. If you fixed a mistake and need it picked up sooner, request a recrawl from the robots.txt report in Google Search Console.

Does robots.txt affect rankings?

Not directly. It controls crawling, not ranking. Keeping crawlers out of low-value URLs helps Google spend its time on the pages you care about, which matters most on large sites. Blocking important pages by mistake can drop them out of search.

Can I block one bot and allow everyone else?

Yes. Keep the default rule on "Allow all" and set that bot to Block. The generator gives it its own group with Disallow: /, and every other crawler follows your normal rules.

Is there a size limit for robots.txt?

Google reads the first 500 KiB of the file and ignores anything after that. A typical robots.txt is a few hundred bytes, so you're unlikely to get close.

Is anything I enter sent to a server?

No. The generator runs entirely in your browser. Your paths and sitemap URLs never leave your device.

More free SEO tools

See all free SEO tools