Wiki Hub › SEO › Robots.txt
SEO

Robots.txt

Last updated: Nov 02, 2026
Robots.txt

Robots.txt is a plain-text file placed at the root of a website that tells automated clients, known as web crawlers or bots, which parts of the site they are asked not to request. It implements the Robots Exclusion Protocol (REP), a convention that compliant crawlers follow voluntarily. The file is not an access-control or security mechanism.

The protocol was proposed in 1994 and operated for nearly three decades as an informal standard. It was formalized as RFC 9309, published by the Internet Engineering Task Force (IETF) in September 2022. Major search engines read robots.txt before crawling a site, and the file is also used to signal preferences to other automated systems, including crawlers that collect data for AI training.

Infobox

Type

Web crawler access convention

Also known as

Robots Exclusion Protocol, Robots Exclusion Standard

Proposed by

Martijn Koster (1994)

Formal standard

RFC 9309 (IETF, September 2022)

Location

/robots.txt at the root of a host

File format

Plain text, UTF-8

Enforcement

Voluntary compliance by crawlers

Overview

A web crawler discovers pages by following links and requests them in bulk. Site operators sometimes want to keep crawlers away from certain areas, for example to reduce server load, avoid crawling duplicate or infinite URL spaces, or keep low-value pages out of crawl queues. Robots.txt gives operators a standard place to state these preferences.

Before requesting other URLs on a host, a compliant crawler first fetches /robots.txt from that host. It then applies the rules matching its own name. Each combination of protocol, host, and port has its own file, so https://example.com/robots.txt does not govern https://blog.example.com/.

Note: Robots.txt controls crawling (requesting URLs), not indexing (appearing in search results). The two are often confused and are covered under Common Misconceptions.

History

Origins

Stylized early 1990s terminal showing web server log lines and a mailing list message.
Early web server logs and mailing list discussions shaped the 1994 robot exclusion proposal.

The Robots Exclusion Protocol is generally credited to Martijn Koster, who proposed it in 1994 on a mailing list for web robot developers. According to commonly cited accounts, the proposal followed incidents in which poorly behaved crawlers overloaded web servers. The convention spread quickly because it required no central authority and was easy for both site owners and crawler authors to adopt.

Informal standard period

From 1994 to 2022, robots.txt had no official standards-body status. Behavior was documented in a 1996 internet draft and in guidance from search engine operators, and implementations differed in details such as wildcard support and handling of errors. Extensions such as Allow, Sitemap, and pattern matching with * and $ were introduced by individual vendors and became widely, though not universally, supported.

Formalization

In July 2019, Google announced that it was working to turn the protocol into an internet standard and released its robots.txt parser as open-source software. The IETF later published the specification as RFC 9309 in September 2022, with the status of Proposed Standard. The document codified existing practice rather than introducing a new design.

File Format and Syntax

A robots.txt file consists of groups of rules. Each group begins with one or more User-agent lines naming the crawler(s) it applies to, followed by rules specifying which paths are disallowed or allowed. Lines beginning with # are comments.

Core directives

Directive

Purpose

Status

User-agent

Names the crawler(s) a group applies to; * matches any crawler

Defined in RFC 9309

Disallow

Path prefix the crawler is asked not to request

Defined in RFC 9309

Allow

Path prefix explicitly permitted, often as an exception within a disallowed path

Defined in RFC 9309

Sitemap

Location of an XML sitemap

Widely supported extension, not part of the core RFC rules

Crawl-delay

Requested pause between requests

Non-standard; supported by some crawlers, ignored by others, including Google

Example

User-agent: *

Disallow: /private/

Allow: /private/public-report.html

User-agent: ExampleBot

Disallow: /

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

In this example, all crawlers are asked to avoid /private/ except one named page, while a crawler identifying as ExampleBot is asked to avoid the entire site.

Matching rules

RFC 9309 specifies that rules match as URL path prefixes and that the most specific (longest) matching rule takes precedence. When an Allow and a Disallow rule are equally specific, the less restrictive Allow applies. The RFC also supports the * wildcard (any sequence of characters) and the $ anchor (end of URL) in paths. Matching is case-sensitive for paths, while crawler names in User-agent lines are matched case-insensitively.

A crawler follows only the single group that best matches its name; rules from other groups, including the * group, are not combined with it.

Crawler Behavior

Retrieval and caching

Crawlers fetch the file via HTTP(S) and may cache it. The RFC recommends that caches generally not be kept longer than 24 hours unless the file is unreachable. The specification also requires crawlers to parse at least 500 kibibytes of the file and allows them to ignore content beyond that limit.

Handling of HTTP status codes

Flowchart of crawler actions for 2xx, 4xx, and 5xx responses when fetching robots.txt.
Crawler decision flow based on the HTTP response to a robots.txt request, as described in RFC 9309.

The treatment of fetch results is defined in RFC 9309:

  • 2xx (success): the file is parsed and its rules applied.
  • 4xx (client error, such as 404): the file is treated as unavailable, and crawlers may access any path.
  • 5xx (server error) or network failure: the crawler should assume complete disallowance temporarily; if the failure persists, behavior may vary by crawler.

A missing robots.txt file therefore generally means no restrictions apply.

Limitations and Common Misconceptions

Not a security measure. Robots.txt is publicly readable, and compliance is voluntary. Malicious or careless bots can ignore it, and the file can reveal the existence of paths the operator would prefer not to advertise. Content requiring protection is normally secured with authentication or server-side access controls.

Blocking is not the same as de-indexing. A URL disallowed in robots.txt can still appear in search results, typically without a description, if other pages link to it. Because the crawler cannot fetch a blocked page, it also cannot see a noindex instruction placed on that page.

The noindex directive in robots.txt is unsupported by Google. Google ended support for it on 1 September 2019. Other engines have varied in their handling, so it is generally not relied upon.

Crawler names must match. A rule applies only if the crawler’s declared User-agent token matches. Operators typically consult each crawler operator’s documentation for the exact token.

Related Mechanisms

Several mechanisms address crawler and indexing behavior at different levels:

Mechanism

Scope

Controls

Robots.txt

Site or path prefix

Crawling

Robots meta tag

Individual HTML page

Indexing and snippet behavior

X-Robots-Tag HTTP header

Individual response, including non-HTML files

Indexing and snippet behavior

Authentication or IP restrictions

Server level

Actual access

Use with AI and Data-Collection Crawlers

Since the early 2020s, operators of large language models and other data-collection systems have published crawler names that site owners can address in robots.txt. Examples reported in public documentation include Google’s Google-Extended token and OpenAI’s GPTBot. Adherence depends on each operator, and robots.txt provides no technical enforcement. Debate continues among publishers, technology companies, and policymakers about whether robots.txt is an adequate mechanism for expressing preferences about AI training, and proposals for additional signals have been discussed. Because this area changes quickly, current crawler names and policies are best verified against operator documentation.

Current Status

Robots.txt remains the primary convention for communicating crawler preferences on the web. RFC 9309 provides a common reference for implementers, though vendor-specific extensions and behaviors persist.

Was this article helpful?
0 of 0 users found this helpful