Skip to content

robots.txt

Short answer

robots.txt tells crawlers which URL paths they may fetch, and is standardised as RFC 9309. It controls crawling, not indexing. A disallowed URL can still be indexed without its content if other pages link to it.

  • Served at /robots.txt at the root of each host and protocol (https://example.com/robots.txt does not cover https://shop.example.com/).
  • Plain text, UTF-8. Groups start with one or more user-agent lines followed by allow / disallow rules.
FieldPurpose
user-agentWhich crawler the group applies to; * matches any crawler without a more specific group.
disallowPath prefix the crawler should not fetch.
allowPath prefix that may be fetched, overriding a broader disallow.
sitemapAbsolute URL of a sitemap. Not tied to any group.

* (any sequence) and $ (end of URL) are supported in paths.

noindex inside robots.txt is not supported. Use the robots meta tag or X-Robots-Tag header instead; Keep a page out of Google has the steps.

The FAQ names no separate token for Baidu’s AI products, so it documents no way to treat them differently from Baidu search. Google, by contrast, has a separate token for Gemini (Google-Extended).

user-agent: *
disallow: /search
allow: /search/about
sitemap: https://example.com/sitemap-index.xml

Sources

  1. RFC 9309: Robots Exclusion ProtocolIETF · standard · ✓ 2026-10-25
  2. How Google interprets the robots.txt specificationGoogle · official · ✓ 2026-10-25
  3. Introduction to robots.txtGoogle Search Central · official · ✓ 2026-10-24
  4. Block Search indexing with noindexGoogle Search Central · official · ✓ 2026-10-25
  5. FAQs of BaiduspiderBaidu · official · ✓ 2026-10-27
  6. 站长指南Sogou · official · ✓ 2026-10-27
  7. Robots协议支持360 Search · official · ✓ 2026-10-27
  8. 头条搜索spider介绍Toutiao Search · official · ✓ 2026-10-27