Web Scraping & Data Collection

robots.txt

Updated July 21, 2026

A file on a website that declares which pages web crawlers are allowed or disallowed from accessing. Ethical scraping respects these directives.

Also known as: Robots Exclusion Protocol (REP), Robots Exclusion Standard, robots exclusion file

robots.txt is a plain-text file placed at the root of a website (always at the exact path /robots.txt) that tells automated crawlers which URLs and directories they may or may not request. It works through a small set of directives: User-agent names the bot a rule applies to, Disallow lists paths to keep out of, and Allow carves exceptions back in. The file is advisory, not enforced. There is no technical mechanism that stops a crawler from requesting a disallowed URL anyway; compliance is voluntary, and honoring the file is treated as a marker of good-faith, ethical crawling.

The convention was proposed by Martijn Koster in February 1994 on the www-talk mailing list, reportedly after a poorly behaved crawler overloaded his server. By mid-1994 it had become an informally agreed, de facto standard among early crawlers such as WebCrawler, Lycos, and AltaVista, with no official governing body. It stayed an unofficial standard for 28 years. Google proposed formalizing it with the IETF in 2019, and it was published as RFC 9309, the Robots Exclusion Protocol, a Proposed Standard, in September 2022.

Today robots.txt is read by search engines, archival crawlers, and competitive-intelligence and web-scraping tools alike. Site operators use it to steer search-engine crawl budget away from low-value pages, and since 2023 it has become a primary lever for allowing or blocking AI training crawlers such as GPTBot, Google-Extended, and CCBot. For anyone building automated monitoring, it is the first file to check and the baseline definition of respectful collection.

How the directives work

A robots.txt file is a sequence of rule groups. Each group opens with one or more User-agent lines naming the crawler the rules target: a specific name like Googlebot or GPTBot, or the wildcard asterisk for all bots. Under that come Disallow lines listing path prefixes the crawler should not request, and optional Allow lines that re-permit narrower paths inside a blocked directory. Disallow with a single slash blocks the entire site; an empty Disallow value blocks nothing.

For the file to be honored under RFC 9309 and Google's own specification, it must be reachable at exactly the site root, served with a text/plain content type, and returned with an HTTP 200 status. A common non-directive addition is the Sitemap line, which points crawlers to an XML sitemap and is independent of any User-agent group. Crawl-delay, which asks bots to space out requests, is widely used but nonstandard, and Google explicitly does not honor it, so throttling for Google must be managed elsewhere.

robots.txt vs. the meta robots tag

These two controls are frequently confused because both mention robots, but they act at different stages. robots.txt operates before a fetch: it tells a crawler which URLs not to request at all, site-wide. The meta robots tag lives in the HTML head of an individual page and controls what a crawler does after it has already fetched that page: chiefly whether to index it and whether to follow its links. The X-Robots-Tag HTTP header does the same job as the meta tag but is set in the server response, which makes it usable for non-HTML files like PDFs.

The distinction has a practical trap. Because a Disallow rule stops the crawler from ever reading the page, it also stops the crawler from seeing any noindex meta tag on that page. A URL blocked in robots.txt can therefore still surface in search results if other sites link to it. To reliably keep a page out of an index, operators must allow crawling and use a noindex tag, not block it in robots.txt.

How competitive-intelligence tools use robots.txt

For competitive-intelligence tooling that monitors rival websites for changes (new pages, pricing updates, blog posts, job listings), a competitor's robots.txt is usually the first file checked before any crawling begins. It reveals which paths the site considers off-limits, whether the operator broadly blocks bots or AI crawlers, and where the sitemap lives. Reading it first lets a tool scope its collection to permitted paths and pace requests accordingly.

Respecting Disallow rules, and throttling in the spirit of crawl-delay even where it is nonstandard, is the working definition of ethical scraping that separates legitimate CI monitoring from abusive scraping. This matters beyond etiquette. Courts have treated ignoring robots.txt as evidence of bad faith or unauthorized access in disputes such as eBay v. Bidder's Edge and AP v. Meltwater, and robots.txt compliance has featured in more recent AI-crawler litigation. Good-faith collection is easier to defend when the collector demonstrably honored the site's stated preferences.

What robots.txt does not do

robots.txt is not an access-control or security mechanism. It publishes, in plain text, the paths an operator would rather crawlers avoid, which means anyone can read it to learn where those paths are. Listing a sensitive directory in a Disallow rule advertises its existence without protecting it, so the file should never be relied on to guard private data. Real protection requires authentication, not a hint to well-behaved bots.

It is also not self-enforcing. Any HTTP client can request a disallowed URL and receive the content, because the file carries no technical teeth. On its own robots.txt is not legally binding either, though as noted it has been cited in litigation as evidence about intent. Finally, it does not manage indexing directly: its job is to control crawling, and the paradox that a blocked page can still be indexed via external links follows directly from that scope. Treat robots.txt as a signal of preference and a courtesy standard, not a wall.

Stop looking terms up. Start tracking them.

meertrack watches your competitors' websites, pricing, and hiring, then alerts you when something meaningful changes.

Or compare 11 CI tools side by side →

Frequently Asked Questions

What is robots.txt and why is it important?

It is a text file at a website's root that lists which URLs crawlers are allowed or asked not to request, using User-agent, Disallow, and Allow directives. It matters because it is the standard way site operators express crawling preferences, and because honoring it is the accepted marker of ethical, good-faith automated collection. For anyone running a crawler, it is the first file to read before requesting anything else.

Is it illegal to ignore robots.txt when scraping a website?

Ignoring it is not inherently illegal, since the file is advisory and carries no binding force by itself. That said, judges have pointed to a crawler disregarding robots.txt when weighing bad-faith or unauthorized-access claims, including eBay v. Bidder's Edge and AP v. Meltwater, and the file has surfaced in recent AI-crawler suits as well. Honoring it is thus both an ethical expectation and something that can tip legal arguments about a collector's intent.

Does robots.txt stop Google from indexing a page?

Not reliably. A Disallow rule stops Google from crawling the URL, but a blocked page can still appear in search results if other sites link to it. Because the crawler never fetches the page, it never sees any noindex meta tag there. To keep a page out of the index, allow crawling and add a noindex tag rather than blocking the URL in robots.txt.

What is the difference between robots.txt and a sitemap?

They are complementary. robots.txt tells crawlers where not to go, listing paths to avoid. A sitemap.xml tells crawlers where to go and what to prioritize, listing URLs worth indexing. They serve opposite functions and are often linked together, since robots.txt commonly includes a Sitemap directive pointing to the XML sitemap. One restricts crawling; the other invites it.

Can robots.txt stop AI crawlers like GPTBot from training on my content?

It can request that they stop, but it cannot force them. Since 2023 site operators have used robots.txt to disallow named AI crawlers such as GPTBot, Google-Extended, and CCBot, and compliant bots honor those rules. Because the file has no enforcement mechanism, a crawler that chooses to ignore it can still access the content. It expresses a preference that well-behaved AI crawlers respect, not a technical block.

Related terms

← Browse the full glossary

You run the business.

We'll watch the competition.

14 days free. 3 competitors. Cancel anytime.