Inferensys

Glossary

Robots.txt

A plain text file placed at the root of a domain that uses directives from the Robots Exclusion Protocol to manage polite bot access and control crawl traffic.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
CRAWL DIRECTIVE PROTOCOL

What is Robots.txt?

The Robots Exclusion Protocol, implemented via a plain text file at the root of a domain, uses directives to manage polite bot access and control crawl traffic.

Robots.txt is a plain text file placed at the root of a domain (e.g., /robots.txt) that instructs automated crawlers which parts of a site they are permitted to access. It functions as a voluntary crawl control mechanism, not a security measure, using directives like User-agent, Disallow, and Allow to define access rules for specific bots. The protocol is foundational to managing crawl budget and preventing server overload.

While compliant bots respect the directives, malicious scrapers often ignore them. The file supports wildcards and the Sitemap directive to point crawlers to the location of XML sitemaps. For granular control over indexing rather than crawling, developers should use X-Robots-Tag HTTP headers or <meta name='robots'> tags, as robots.txt only prevents crawling, not indexing of linked-to URLs.

ROBOTS.TX

Core Directives and Capabilities

The Robots Exclusion Protocol relies on a specific set of directives to manage crawler behavior. Understanding these core commands is essential for precise crawl budget optimization and access control.

01

User-agent: The Target Selector

The User-agent directive specifies which crawler the subsequent rules apply to. It acts as a case-insensitive substring match against the bot's self-reported token.

  • Universal Match: Using User-agent: * applies rules to all crawlers that do not have a specific block defined.
  • Specific Bot: User-agent: Googlebot targets only Google's primary crawler.
  • Precedence Logic: Bots follow the most specific matching block. If a block for Googlebot-News exists, it ignores the generic Googlebot block.
  • Multiple Agents: You can list multiple user-agents on separate lines before a directive set to apply rules to a group.
500+
Known Bot Tokens
02

Disallow: The Access Barrier

The Disallow directive instructs compliant bots not to crawl the specified relative path. It is the primary mechanism for managing crawl budget and hiding non-public resources.

  • Path Prefix: Disallow: /admin blocks /admin, /admin.php, and /admin/login.
  • Root Block: Disallow: / blocks the entire site. This is distinct from a missing robots.txt file, which implies permission.
  • Empty Value: Disallow: (with no path) allows crawling of everything, equivalent to Allow: /.
  • Trailing Wildcard: While not standard, major engines treat Disallow: /*.pdf$ as a pattern match for file extensions.
03

Allow: The Granular Exception

The Allow directive creates exceptions within a broader Disallow rule. It is primarily used by Googlebot to grant access to a specific resource inside a blocked directory.

  • Specificity Wins: Disallow: /blog followed by Allow: /blog/public ensures only the public subfolder is crawlable.
  • Order Agnostic: Google evaluates the most specific path rule regardless of its position in the file.
  • Parameter Stripping: Bots generally ignore query strings when matching Allow/Disallow paths unless explicitly handled.
  • Non-Standard: While supported by major search engines, Allow is not part of the original 1994 standard.
04

Sitemap: The Discovery Pointer

The Sitemap directive is a non-blocking instruction that points bots to the absolute URL of an XML sitemap. It decouples discovery from crawling rules.

  • Absolute URL: Sitemap: https://example.com/sitemap.xml is required. Relative paths are invalid.
  • Cross-Domain: Sitemaps can point to URLs on other domains if verified via Search Console, enabling cross-domain sitemap hosting.
  • Multiple Files: You can list multiple Sitemap directives or point to a Sitemap Index file containing up to 50,000 sitemaps.
  • Location: The directive can be placed anywhere in the file and is not bound to a specific User-agent block.
05

Crawl-delay: The Rate Limiter

The Crawl-delay directive specifies the number of seconds a bot should wait between successive requests. It protects server resources from aggressive crawlers.

  • Integer Value: Crawl-delay: 10 requests a 10-second pause between hits.
  • Google Ignored: Googlebot does not officially support this directive. Use Google Search Console to manage crawl rate.
  • Bing/Yahoo Support: Microsoft's crawlers respect this directive for managing load on origin servers.
  • Dynamic Alternative: For modern rate limiting, a 429 HTTP status code with a Retry-After header is more reliable than this static file directive.
06

Wildcards and Pattern Matching

While not part of the original standard, Google and Bing support limited pattern matching to reduce file bloat when blocking dynamic URLs.

  • Asterisk (*): Matches any sequence of characters. Disallow: /search?q=* blocks all search query pages.
  • Dollar Sign ($): Matches the end of a URL. Disallow: /*.pdf$ blocks PDF files but not /pdf-guide.
  • Escaping: There is no official escape character. To block a literal * in a URL path, you must rely on the bot's heuristic parsing.
  • Regex Limitation: Full regular expressions are not supported. Complex filtering logic should be handled via X-Robots-Tag HTTP headers.
ROBOTS.TXT PROTOCOL

Frequently Asked Questions

Essential questions about the Robots Exclusion Protocol, its directives, and how it governs crawler access to your site.

A robots.txt file is a plain text file placed at the root of a domain (e.g., example.com/robots.txt) that implements the Robots Exclusion Protocol (REP). It works by providing directives to automated crawlers—primarily search engine bots—specifying which parts of a website they are permitted to access and index. When a compliant crawler visits a site, its first action is to request this file. The file uses a syntax of User-agent lines to target specific bots and Disallow or Allow rules to define path-based access controls. It is a voluntary standard; it functions as a polite 'No Entry' sign rather than a security mechanism, relying on the good-faith compliance of legitimate bots like Googlebot and Bingbot.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.