What is robots.txt?

DefinitionThe robots.txt file is a plain-text file at the root of a website that uses the Robots Exclusion Protocol to tell web crawlers which parts of the site they may or may not visit.

Martijn Koster proposed the Robots Exclusion Protocol in 1994, and it became a de facto standard for decades before Google and others submitted it to the IETF. It was published as RFC 9309 in 2022.

A robots.txt file contains groups of rules. Each group names a crawler with a User-agent line and lists paths it may not crawl with Disallow lines, or may crawl with Allow lines. The file can also point crawlers to a sitemap.

The rules are voluntary: well-behaved crawlers follow them, but robots.txt doesn't secure content, and blocking a URL from crawling doesn't guarantee it stays out of search results, which is a job for noindex. Site owners now also use robots.txt to opt out of AI crawlers and AI training.

robots.txt resources

Common questions about robots.txt

Where does a robots.txt file go?

It must sit at the top level of a host, such as example.com/robots.txt, and it applies only to that host, protocol and port. A subdomain like blog.example.com needs its own robots.txt file, and crawlers ignore robots.txt files placed in subdirectories.

What happens if a site doesn't have a robots.txt file?

Crawlers treat a missing robots.txt file, which returns a 404 or another 4xx error, as permission to crawl the whole site. Under RFC 9309, if the server returns a 5xx error instead, crawlers are expected to treat the whole site as off limits until the file can be fetched.

Does robots.txt support wildcards?

Yes. RFC 9309 defines two special characters for paths in Allow and Disallow rules: an asterisk matches any sequence of characters, and a dollar sign marks the end of a URL. Together they let one rule block, for example, every URL that ends in .pdf.

Is robots.txt case sensitive?

Partly. The file name must be all lowercase, and the paths in Allow and Disallow rules are case sensitive, so Disallow: /Private doesn't block /private. Rule names such as User-agent and Disallow, and the crawler names in User-agent lines, aren't case sensitive.

Compare: robots.txt vs. noindex

Topics: SEO and search, Web standards and protocols

Cite this definition
APA

What is robots.txt? (2026, November 22). Glossary. https://glossary.io/robots-txt/

MLA

“What Is robots.txt?” Glossary, Coywolf, 22 Nov. 2026, glossary.io/robots-txt/.

Chicago

“What Is robots.txt?” Glossary. Coywolf. November 22, 2026. https://glossary.io/robots-txt/.

HTML link
<a href="https://glossary.io/robots-txt/">What is robots.txt?</a>

Published · Updated