<link rel="stylesheet" type="text/css" href="/mirawhite.css">

Robots.txt generator and tester

Write your robots.txt for free with ready-made presets, then check which URLs Googlebot, Bingbot or GPTBot may crawl.

Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.

Robots.txt generator

Your rules and URLs stay in your browser: nothing is sent.

Generate a robots.txt

Presets

Group 1
Separate several robots with commas. * means every robot.

Starts with /. * matches anything, $ marks the end. Empty Disallow = allow everything.

One full URL per line, e.g. https://example.com/sitemap.xml

Your robots.txt

Choose a preset or edit a group to see your file.

Test a URL

Paste any robots.txt, or use the file generated above.
One per line, e.g. https://example.com/blog/post?id=3 or /blog/
Robot name, such as Googlebot or GPTBot.

Paste a robots.txt and a URL to test it.

How to use it

  1. Start from a preset (allow everything, block a staging site, block AI training bots, WordPress) or edit the groups yourself.
  2. For each group, list the user-agents, then add Allow and Disallow rules, and your sitemap URLs below.
  3. Copy or download the file and place it at the root of your site (https://your-site.com/robots.txt).
  4. To check a file, paste it in the tester with one or more URLs (one per line): it flags syntax errors, tells you whether that robot may crawl each URL and which line decides, and can load the file into the generator.

Example

Input

Preset “Block AI training bots”, sitemap https://example.com/sitemap.xml

Output

User-agent: *
Disallow:

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: Bytespider
User-agent: meta-externalagent
User-agent: Amazonbot
Disallow: /

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

Good to know

  • robots.txt is a request, not a lock: well-behaved crawlers follow it, others ignore it.
  • Disallow does not prevent indexing: a blocked URL can still appear in Google if other sites link to it. Use a noindex tag (on a crawlable page) or a password instead.
  • The tester follows Google’s documented rules; Bing and other crawlers may differ slightly, for instance on Crawl-delay, which Google ignores.
  • Everything happens in your browser: your rules and URLs are not sent to any server.

Frequently asked questions

How do I create a robots.txt file?

Pick a preset or fill in the groups: one or more user-agents, then Allow and Disallow rules, then your sitemap URLs. Download the file and upload it as robots.txt at the root of your domain, for example https://example.com/robots.txt; a file in a subfolder is ignored.

How do I block AI crawlers like GPTBot in robots.txt?

Choose the “Block AI training bots” preset: it keeps your site open to search engines and adds Disallow: / for GPTBot, ClaudeBot, CCBot, Google-Extended, Applebot-Extended, Bytespider, meta-externalagent and Amazonbot. Assistant bots such as OAI-SearchBot or PerplexityBot can be added to the list if you want to block them too.

What robots.txt should I use for WordPress?

The WordPress preset gives the usual rules: Disallow: /wp-admin/ with Allow: /wp-admin/admin-ajax.php, which some themes and plugins need. Add your sitemap, often /wp-sitemap.xml or the one made by Yoast (/sitemap_index.xml). Avoid blocking /wp-content/, which holds your images and CSS.

Does Disallow remove a page from Google?

No. Disallow stops crawling, not indexing: a blocked URL can still appear in results if other sites link to it, just without a description. To remove a page, let Google crawl it and add a noindex tag, or protect it with a password.

How do I test whether a URL is blocked by robots.txt?

Paste a robots.txt and a URL into the tester, then choose the robot. It applies Google’s rules: the group with the most specific matching user-agent wins, then the longest matching rule, and Allow wins a tie. It shows the line that decides, with * and $ wildcards supported.

How do I add a sitemap to robots.txt?

Add a line Sitemap: followed by the full URL, such as Sitemap: https://example.com/sitemap.xml. It can appear anywhere in the file, outside the groups, and you can list several sitemaps. Type them under “Sitemap URLs” and the tool writes the lines for you.

Sources

Checked on November 26, 2026

← Back to all tools