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.
Location and format
Section titled “Location and format”- Served at
/robots.txtat the root of each host and protocol (https://example.com/robots.txtdoes not coverhttps://shop.example.com/). - Plain text, UTF-8. Groups start with one or more
user-agentlines followed byallow/disallowrules.
Supported fields (Google)
Section titled “Supported fields (Google)”| Field | Purpose |
|---|---|
user-agent | Which crawler the group applies to; * matches any crawler without a more specific group. |
disallow | Path prefix the crawler should not fetch. |
allow | Path prefix that may be fetched, overriding a broader disallow. |
sitemap | Absolute URL of a sitemap. Not tied to any group. |
* (any sequence) and $ (end of URL) are supported in paths.
Limits and caching
Section titled “Limits and caching”Crawling is not indexing
Section titled “Crawling is not indexing”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).
Other Chinese search engines
Section titled “Other Chinese search engines”Example
Section titled “Example”user-agent: *disallow: /searchallow: /search/about
sitemap: https://example.com/sitemap-index.xmlSee also
Section titled “See also”- Configure robots.txt for AI crawlers — per-crawler rules for AI search and training bots.