← Imperial Products / Tools / Robots.txt Generator

Robots.txt Generator

Build a valid robots.txt file for your website. Control crawler access, block AI bots, set crawl delays, and add your sitemap — all without writing a single line by hand.

Quick Presets
Global Options
User-Agent Rules
Preview — robots.txt
Copied!

What is robots.txt?

A robots.txt file is a plain-text file placed at the root of your website (e.g. https://example.com/robots.txt) that instructs web crawlers which pages or sections of your site they are allowed or not allowed to access. It is part of the Robots Exclusion Protocol (REP), an informal standard that has been followed by major search engines since 1994.

The file does not prevent access — it is a voluntary directive. Well-behaved bots like Googlebot and Bingbot respect it, but malicious scrapers may ignore it entirely.

How robots.txt Works

When a crawler visits your site, it first fetches /robots.txt before crawling any other page. It reads the file top to bottom, finds the first User-agent block that matches its own name (or the wildcard *), and obeys the Allow and Disallow rules within that block. Rules are processed in order; the first matching rule wins.

The file is case-sensitive for paths but case-insensitive for directives (User-agent, Disallow, etc.). A blank Disallow: value means "allow everything." A Disallow: / means "block everything."

Common Directives Explained

DirectiveDescription
User-agent Specifies which crawler the following rules apply to. Use * to target all crawlers. Each rule block begins with one or more User-agent lines.
Disallow Tells the crawler not to crawl a given path. Disallow: /private/ blocks the entire /private/ directory. Disallow: / blocks the whole site.
Allow Explicitly permits access to a path, even if a parent path is disallowed. Supported by Google. Useful for allowing specific pages within a blocked directory.
Sitemap Points crawlers to your XML sitemap. Not part of the original REP but widely supported. Helps search engines discover all your URLs efficiently.
Crawl-delay Requests that a bot waits the specified number of seconds between requests. Reduces server load. Note: Googlebot ignores this directive and uses its own rate-limiting.

Blocking AI Crawlers

Since 2023, a wave of AI companies have deployed crawlers to scrape web content for training large language models. Unlike search engine crawlers, these bots do not send traffic back to your site. Many webmasters choose to block them to protect their content and reduce server load. The following crawlers can be blocked via robots.txt:

GPTBot
OpenAI — training data
ChatGPT-User
OpenAI — browsing plugin
CCBot
Common Crawl — dataset
anthropic-ai
Anthropic — training data
Claude-Web
Anthropic — web access
Google-Extended
Google — Bard/Gemini training
Bytespider
ByteDance — TikTok AI

Note: blocking these bots only works if they honour robots.txt. Reputable companies like OpenAI and Anthropic state they respect the protocol. Smaller or less reputable scrapers may not.

Best Practices

More Free Online Tools