Make a robots.txt that does what you think it does
A robots.txt file is a few lines of text, but a small slip can hide a whole site from Google or let a crawler into pages you meant to block. This generator writes the file from your choices, following the published standard (RFC 9309) and Google's documented rules, and checks the result as you go: type any page into "Check a page" and it shows which crawlers may fetch it and which line decides.
How to use it
- Start from a preset: allow everything, WordPress's own default, or block everything for a staging site.
- Add paths to block for all crawlers, such as
/admin/or/cart/, and Allow rules to re-open part of a blocked folder. - Choose an AI policy: allow all AI bots, block AI training but stay in AI search, or block them all. Fine-tune bot by bot.
- Optionally give one crawler its own rules, add your sitemap URL and a crawl delay.
- Copy or download the file and upload it so it loads at
https://yoursite.com/robots.txt.
What goes in a robots.txt file
User-agent: *
Disallow: /admin/
Allow: /admin/help/
User-agent: GPTBot
User-agent: ClaudeBot
Disallow: /
Sitemap: https://example.com/sitemap.xml
- User-agent names the crawler a group is for.
*means every crawler that has no group of its own. Several User-agent lines in a row share the rules below them. - Disallow blocks every URL that starts with the path.
Disallow: /adminblocks/admin/and also/administrator; add the slash to block only the folder. - Allow re-opens a path inside a blocked one. When rules conflict, the longer path wins, and Allow wins a tie. The order of lines does not matter.
- * matches any characters and a final $ marks the end of the URL, so
Disallow: /*.pdf$blocks every PDF. - Sitemap gives the full URL of your sitemap. It applies to all crawlers, wherever it sits in the file.
- Crawl-delay asks a crawler to wait between requests. Bing and some AI crawlers honour it; Google ignores it.
The mistake that catches most sites
A crawler obeys only the most specific group that names it. Add a User-agent: Googlebot group and Googlebot stops reading the User-agent: * group entirely, so the /admin/ block you wrote for everyone no longer applies to it. That is why the generator copies the rules for all crawlers into any crawler's own group unless you untick "Also apply the rules for all crawlers". For the same reason, AI bots you allow are left out of the file: unnamed, they follow your general rules, while a group saying Allow: / would let them past them.
AI crawlers: training, search and assistants
AI companies now run separate bots for separate jobs, so you can opt out of one without the others. Blocking a training bot keeps your pages out of future models. Blocking a search bot removes you from that company's AI answers, which also means no citations or links back.
| Token | Company | What blocking it does |
|---|---|---|
| GPTBot | OpenAI | Keeps your pages out of OpenAI model training |
| OAI-SearchBot | OpenAI | Removes you from ChatGPT search answers |
| ChatGPT-User | OpenAI | Asks ChatGPT not to open your pages for users; OpenAI says robots.txt may not apply |
| ClaudeBot | Anthropic | Keeps your pages out of Claude model training |
| Claude-SearchBot | Anthropic | Removes you from Claude's search results |
| Claude-User | Anthropic | Stops Claude opening your pages when a user asks |
| Google-Extended | Stops Gemini training and grounding on your pages; Google Search is unaffected | |
| Applebot-Extended | Apple | Stops Apple AI training; Siri and Spotlight search are unaffected |
| PerplexityBot | Perplexity | Removes you from Perplexity answers |
| Perplexity-User | Perplexity | Little: Perplexity says this fetcher generally ignores robots.txt |
| meta-externalagent | Meta | Keeps your pages out of Meta AI training |
| meta-webindexer | Meta | Removes you from Meta AI search answers |
| meta-externalfetcher | Meta | Asks Meta AI not to open your links for users; Meta says it may bypass robots.txt |
| CCBot | Common Crawl | Keeps your pages out of the open web archive many models train on |
| Bytespider | ByteDance | Keeps your pages out of ByteDance AI crawling |
| Amazonbot | Amazon | Keeps your pages out of Amazon's crawl, which may train Amazon AI |
Googlebot and Bingbot are not in this list on purpose. They power Google and Bing search, including Google's AI Overviews and Microsoft Copilot answers, so blocking them removes you from search altogether.
Common robots.txt examples
- Allow everything:
User-agent: *thenAllow: /. An emptyDisallow:means the same. - Block everything (staging only):
User-agent: *thenDisallow: /. Protect the site with a password too. - WordPress default:
Disallow: /wp-admin/plusAllow: /wp-admin/admin-ajax.php, and the sitemap WordPress serves at/wp-sitemap.xml(or your SEO plugin's sitemap). - Block internal search results:
Disallow: /search, orDisallow: /*?s=on WordPress.
What robots.txt cannot do
- It does not remove pages from Google. A blocked page can still be indexed from links. Use a
noindexmeta tag orX-Robots-Tagheader, and leave the page crawlable so Google can see it. - It is not security. The file is public and voluntary. Never list secret URLs in it; protect them with a login.
- Do not block CSS or JavaScript. Google renders pages like a browser; blocking
/wp-content/,/_next/or*.jscan hurt how your pages rank. The generator warns you. - Keep it reachable. If robots.txt returns a server error, Google stops crawling your site until it can read the file. A missing file (404) just means "crawl everything".
Sources
- RFC 9309, the Robots Exclusion Protocol
- Google Search Central: create a robots.txt file and Google's common crawlers
- OpenAI crawlers, Anthropic crawlers, Perplexity crawlers, Applebot and Meta web crawlers
Related tools
Check a live site's file with the robots.txt tester, see which AI crawlers a domain allows with the AI crawler checker, add opt-out meta tags and headers with the AI training opt-out kit, and give AI models a map of your content with an llms.txt file.