🔍 SEO

Robots.txt Generator

Define crawler directives, protect crawl budget, block unwanted AI scrapers, and generate a valid robots.txt file instantly.

Presets:

    

What is Robots.txt and How Does It Control Web Crawlers?

A robots.txt file is a plain text document placed at the root of a domain that communicates crawling permissions to automated web robots (such as Googlebot, Bingbot, and AI scrapers). By declaring User-agent blocks paired with Disallow and Allow directives, site owners conserve server crawl bandwidth and prevent bots from traversing administrative directories, faceted search filters, or duplicate query paths.

Robots.txt Directives and Precedence Rules

Web robots evaluate robots.txt directives starting with the most specific matching User-agent block. If a named block exists for a specific bot (such as User-agent: Googlebot), that crawler disregards the generic User-agent: * wildcard block entirely. Understanding this separation prevents accidentally blocking search bots while trying to restrict generic crawlers.

Robots.txt Specification & Directives Matrix

The table below summarizes the standardized directive vocabulary recognized by major search crawlers under the IETF RFC 9309 specification:

Directive Syntax Example Crawler Action Critical SEO Implication
User-agent User-agent: Googlebot Defines the targeted bot Specific bot blocks override the wildcard * block.
Disallow: /path/ Disallow: /admin/ Blocks crawling of subpaths Conserves crawl budget; does not prevent indexing if linked externally.
Allow: /path/ Allow: /admin/public/ Explicitly permits crawling Carves out exceptions inside broader Disallow directories.
End Anchor $ Disallow: /*.pdf$ Matches exact path termination Restricts specific file extensions or exact matching URLs.
Wildcard * Disallow: /*?*sort= Matches any character sequence Blocks repetitive faceted navigation or tracking parameter URLs.
Sitemap: Sitemap: https://.../sitemap.xml Declares XML sitemap location Informs crawlers of indexable URLs globally across all bots.

The RFC 9309 Protocol Standard and Crawler Evaluation Architecture

First created in 1994 and formally standardized by the Internet Engineering Task Force (IETF) as RFC 9309 in 2022, the Robots Exclusion Protocol (REP) establishes the communication rules between web servers and automated agents. Before requesting any webpage, an automated crawler must first request the robots.txt file located at the domain root.

Crawlers fetch and parse robots.txt according to several strict technical rules:

The Crucial Distinction: Crawling versus Indexing

A widespread misconception in technical SEO is that adding a Disallow rule prevents a page from appearing in Google search results. In reality, robots.txt controls crawling, not indexing:

To permanently exclude a page from Google search results, you must leave the page crawlable in robots.txt and add a noindex robots meta tag to the HTML head. If the page is disallowed in robots.txt, Googlebot will never crawl the page to discover the noindex directive.

Directive Precedence and Longest Path Matching Rules

When multiple directives apply to the same URL, search engines resolve conflicts by evaluating path specificity based on character count. Under RFC 9309 standards, the rule with the longest character length takes precedence over shorter rules:

In this scenario, a URL like https://example.com/store/specials/offer will be crawled because the Allow directive contains 16 characters compared to the 8 characters of the Disallow directive. If both an Allow and a Disallow rule have the exact same character length, the Allow directive wins by default.

Wildcard Patterns: Asterisks and Dollar Signs

Standard robots.txt syntax supports two pattern-matching operators:

Managing Generative AI Scrapers vs Search Engine Indexers

The rapid rise of large language models has led to specialized bots that crawl websites exclusively to train artificial intelligence models without sending referral search traffic. Website owners can selectively restrict AI scrapers while preserving organic search visibility:

To restrict AI model training while allowing commercial search indexing, declare explicit User-agent blocks for the AI scrapers with a Disallow: / rule, while maintaining a permissive User-agent: * rule for general search bots.

Crawl Budget Optimization for Large Websites

For eCommerce portals and large content publishers with tens of thousands of URLs, server crawl bandwidth is finite. Efficient robots.txt configuration ensures search bots spend time discovering revenue-generating pages rather than getting trapped in infinite URL parameters:

Privacy and Client-Side Security

Utility369 compiles your robots.txt directives completely inside your browser. Your server folder structures, sensitive path patterns, and XML sitemap locations are never transmitted to external servers or logged in third-party databases.

Frequently Asked Questions

Does Disallow in robots.txt prevent a webpage from being indexed in Google?

No. Disallow prevents search engine crawlers from requesting and fetching the page content. If external websites link to that disallowed URL, Google can still index the URL and display it as a bare link without a description. To completely exclude a page from search results, remove the Disallow rule and place a noindex meta tag on the page so Googlebot can crawl the instruction.

Where should the robots.txt file be uploaded on a web server?

The robots.txt file must reside at the top-level root directory of your domain (e.g. https://example.com/robots.txt). Files located in subdirectories (such as example.com/sub/robots.txt) are ignored by search crawlers. Subdomains require their own distinct robots.txt file at their respective root.

Can robots.txt be used to protect private or confidential user data?

No. Robots.txt is a publicly accessible file and compliant crawlers obey it voluntarily. Malicious scrapers and bad actors ignore robots.txt directives. Sensitive content, administrative portals, and staging environments should always be secured behind server-level HTTP authentication or password logins.

How does Google resolve conflicts between Allow and Disallow rules?

Google follows the longest matching rule principle based on character count. If an Allow directive and a Disallow directive match the same URL path, the rule with the greater number of characters takes precedence. If both rules have the identical character length, the Allow directive wins.

How can I block generative AI scrapers while keeping Googlebot allowed?

You can declare targeted User-agent blocks for specific AI bots such as GPTBot, ChatGPT-User, Anthropic-AI, and Bytespider with a Disallow: / directive, while maintaining a standard User-agent: * block that permits commercial search engines.

Where should the Sitemap directive be placed in robots.txt?

The Sitemap directive is a global instruction that applies to all search crawlers. It is standard practice to place one or more Sitemap directives at the bottom of the robots.txt file using absolute URLs (e.g. Sitemap: https://example.com/sitemap.xml).

Why should CSS and JavaScript files never be blocked in robots.txt?

Modern search crawlers like Googlebot render webpages identically to modern web browsers. If CSS stylesheets, fonts, or JavaScript files are disallowed in robots.txt, Google cannot evaluate page layout, responsive design, or mobile usability, which can harm organic rankings.

Does Googlebot honor the Crawl-delay directive in robots.txt?

No, Googlebot completely ignores the Crawl-delay directive because it operates on sophisticated automated crawl rate algorithms. Other search engines like Bing, Yandex, and Yahoo do honor Crawl-delay to regulate crawling frequency.

What is the difference between an asterisk wildcard and a dollar sign in robots.txt?

The asterisk wildcard (*) matches any sequence of zero or more characters within a URL path. The dollar sign ($) indicates the end of a URL path, commonly used to target specific file extensions such as Disallow: /*.pdf$.

What happens if a website does not have a robots.txt file?

If a server returns a 404 Not Found error for robots.txt, search crawlers assume that no crawling restrictions exist on the domain and proceed to crawl all discoverable, public pages on the website.