# Robots.txt Generator

> The Robots.txt Generator builds a valid robots.txt file from presets and a custom rules builder, including ready-made rules to allow or block AI crawlers such as GPTBot, ClaudeBot and PerplexityBot, plus your sitemap line.

URL: https://atechcraft.com/robots-txt-generator/
Category: SEO Tools
Last updated: 2026-12-01
Author: Abdul Moid Khan, ATechCraft

Runs in your browser. Your data never leaves your device.

## How to use the Robots.txt Generator

1. Choose a preset: allow all, block all, WordPress, or allow or block AI crawlers.
2. Add custom rules for specific user agents and paths if you need them.
3. Enter your sitemap URL.
4. Copy or download the file and upload it to the root of your site as /robots.txt.

## What is a robots.txt generator?

A robots.txt generator creates the plain text file that tells web crawlers which parts of your site they may visit. This tool builds a valid robots.txt from presets (allow all, block all, WordPress, block AI training crawlers, allow AI crawlers) and a custom rules builder, adds your sitemap line, and lets you copy or download the file.

You upload the result to the root of your website so it is available at `https://yourdomain.com/robots.txt`.

## How does robots.txt work?

robots.txt follows the Robots Exclusion Protocol, which became an official internet standard in 2022 as [RFC 9309](https://www.rfc-editor.org/rfc/rfc9309.html). The file is made of groups. Each group starts with one or more `User-agent` lines naming crawlers, followed by `Allow` and `Disallow` rules for URL paths.

```text
User-agent: *
Disallow: /admin/

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

A crawler looks for the group that matches its name most specifically. If there is a group for `GPTBot`, GPTBot follows that group and ignores the `*` group. Within a group, the longest matching path wins, so `Allow: /admin/help/` beats `Disallow: /admin/` for help pages. An empty `Disallow:` means "nothing is blocked".

## Can I block AI crawlers but stay in Google?

Yes. AI companies use separate user agents for training data and for search features, and you can treat them differently. The "Block AI training" preset keeps all search crawlers allowed and disallows these agents:

| User agent | Operator | Purpose |
| --- | --- | --- |
| GPTBot | OpenAI | Collects data that may train models |
| ClaudeBot | Anthropic | Collects data that may train models |
| CCBot | Common Crawl | Open web archive used by many AI projects |
| Google-Extended | Google | Controls use in Gemini models; does not affect Google Search |
| Applebot-Extended | Apple | Controls use in Apple's AI models |
| PerplexityBot | Perplexity | Indexes pages for Perplexity answers |

The "Allow AI crawlers" preset does the opposite: it lists these agents and search-time agents such as OAI-SearchBot, ChatGPT-User, Claude-SearchBot and Claude-User with `Allow: /`, which some site owners use to signal they welcome AI search visibility. These names match each company's documentation as of December 2026; for example, see [OpenAI's crawler page](https://platform.openai.com/docs/bots) and [Google's list of common crawlers](https://developers.google.com/search/docs/crawling-indexing/google-common-crawlers).

## Worked example: a WordPress site

You run a WordPress blog and want to block AI training but allow search. Choose the WordPress preset, then add a second group for AI crawlers (or start from the "Block AI training" preset and add the WordPress paths). The result:

```text
User-agent: *
Allow: /wp-admin/admin-ajax.php
Disallow: /wp-admin/
Disallow: /?s=
Disallow: /search/

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: PerplexityBot
Disallow: /

Sitemap: https://myblog.pk/sitemap_index.xml
```

The `admin-ajax.php` line stays allowed because some themes need it to load content for visitors.

## Tips

1. **Never block CSS or JavaScript files** that your pages need. Google renders pages and needs these files to see your layout.
2. **Don't use robots.txt to hide private pages.** The file is public, and blocked URLs can still appear in search if other sites link to them. Use a `noindex` meta tag (see the [Meta Tag Generator](https://atechcraft.com/meta-tag-generator/)) or password protection.
3. **Add your sitemap.** Build one with the [XML Sitemap Generator](https://atechcraft.com/sitemap-generator/) and list it at the bottom.
4. **Paths are case-sensitive.** `/Admin/` and `/admin/` are different paths.
5. **Test after uploading.** Visit `/robots.txt` in a browser and check it in Google Search Console's robots.txt report.

## Limitations

robots.txt is a request, not a lock. Reputable crawlers follow it; scrapers and malicious bots can ignore it. Blocking AI crawlers only affects future crawling; it does not remove content already collected. Some AI tools also fetch pages when a user pastes a link, which may follow different rules. To guide AI assistants toward your best pages instead, add an [llms.txt file](https://atechcraft.com/llms-txt-generator/). For redirect rules on Apache servers, use the [.htaccess Redirect Generator](https://atechcraft.com/htaccess-redirect-generator/).

## Frequently asked questions

### Where does robots.txt go?

At the root of the host, for example https://example.com/robots.txt. A file in a subfolder is ignored.

### Does robots.txt keep a page out of Google?

Not reliably. It stops crawling, but a blocked URL can still be indexed if other pages link to it. Use a noindex meta tag on a crawlable page to keep it out of results.

### Can I block AI training but stay in search?

Yes. You can disallow training crawlers like GPTBot, ClaudeBot, CCBot and Google-Extended while still allowing Googlebot and Bingbot. Blocking Google-Extended does not affect Google Search.

### Do all bots obey robots.txt?

Well-behaved crawlers from major companies do. Malicious bots can ignore it, so it is not a security tool.
