Robots.txt Generator

Create, validate, and download robots.txt files for your website. Configure user-agent rules, sitemaps, crawl-delay, and export instantly.

Quick Presets

Configuration

Rule Group 1

Preview

User-agent: *
Allow: /

Validation

No issues found. Your robots.txt looks good.

FAQ

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

A. No. robots.txt controls crawling, not indexing. Google can still list a blocked URL (without a snippet) if other pages link to it. To keep a page out of search results, allow crawling and use a noindex meta tag or header instead.

Q. How do I block all crawlers?

A. Use User-agent: * with Disallow: /. Pages that are already indexed are not removed by this alone.

Q. How do I opt out of AI training?

A. Disallow the training crawlers: GPTBot (OpenAI), Google-Extended (Gemini; it does not affect Google Search), ClaudeBot (Anthropic) and CCBot (Common Crawl). The Block AI Training preset does this and keeps search crawlers allowed.

Q. Where should robots.txt go?

A. At the root of each host, for example https://example.com/robots.txt. A file in a subdirectory is ignored, and each subdomain needs its own file.

Rules this tool follows

  • Google supports only user-agent, allow, disallow and sitemap. Crawl-delay is ignored by Google.
  • Paths must start with /. Google supports * (any characters) and $ (end of URL). When rules conflict, Google uses the most specific (longest) rule, and the least restrictive one on a tie.
  • robots.txt controls crawling, not indexing. A blocked URL can still appear in results without a snippet. Use noindex to keep a page out of search.
  • Sitemap must be a full URL including https://. Google reads at most 500 KiB of the file.
Sources

Last checked: November 25, 2026 (by loresync). Crawler names and policies change; check each vendor's page before relying on a rule.

What Is a robots.txt File?

A robots.txt file is a plain text file placed at the root of your website that tells web crawlers which pages or sections they are allowed or not allowed to access. It follows the Robots Exclusion Protocol (RFC 9309), and well-behaved crawlers such as Googlebot and Bingbot read it before crawling. It controls crawling, not indexing: to keep a page out of search results, use a noindex tag instead of blocking it here.

robots.txt Syntax Explained

A robots.txt file consists of one or more rule groups. Each group starts with a User-agent directive followed by Allow and Disallow rules. Here is a basic example:

User-agent: *
Allow: /
Disallow: /admin/
Disallow: /private/

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

The wildcard * matches all crawlers. You can create separate rule groups for specific bots like Googlebot or Bingbot. The Sitemap directive tells crawlers where to find your XML sitemap.

How to Use This Generator

  1. Choose a preset or start from scratch. Presets cover common scenarios like allowing all bots, blocking all bots, blocking AI crawlers, or a standard SEO setup.
  2. Add user-agent groups for each bot or group of bots you want to configure. Select from common bots or enter a custom name.
  3. Define Allow and Disallow rules for each user-agent. Add as many path rules as needed.
  4. Set optional parameters like Crawl-delay (ignored by Google) and Sitemap URL.
  5. Review the live preview with syntax highlighting and check validation warnings.
  6. Copy or download the generated robots.txt file and place it at the root of your website.

Where to Place robots.txt

The robots.txt file must be placed at the root of your domain. For example, if your site is https://example.com, the file should be accessible at https://example.com/robots.txt. It will not work if placed in a subdirectory. Each subdomain needs its own robots.txt file.

Common robots.txt Mistakes

  • Blocking a page in robots.txt to hide it from search results. Google may still list the URL; use noindex for that.
  • Using Disallow: / for all bots, which blocks your entire site from search engines.
  • Placing the file in the wrong directory or on a different subdomain.
  • Not including a Sitemap directive, which helps crawlers discover all your pages.
  • Using relative paths instead of paths starting with a forward slash.

Blocking AI Crawlers

Many site owners want to keep their content out of AI model training. The training crawlers are GPTBot (OpenAI), ClaudeBot (Anthropic) and CCBot (Common Crawl); Google-Extended is a token that opts out of Gemini training without affecting Google Search. Search and user-initiated agents such as OAI-SearchBot and ChatGPT-User are separate, and OpenAI notes robots.txt may not apply to ChatGPT-User. Use the "Block AI Training" preset above for a quick configuration.