LLMSdocs
English

Page-level rules: the robots meta tag and X-Robots-Tag

robots.txt decides whether a URL is fetched; the robots meta tag and the X-Robots-Tag header decide what a search engine may do with a page or file once it has been fetched, such as leaving it out of the index or showing no snippet.

Type: Reference
On this page
  1. Rules Google Search supports
  2. Rules for one crawler
  3. Keeping part of a page out of snippets
  4. Files without a head: X-Robots-Tag
  5. The rule must be crawled to be seen
  6. Other search engines
  7. See also
  8. References

Indexing and serving rules attach to a single response. In an HTML page they are written in a meta element; for any response, HTML or not, they can be sent in an X-Robots-Tag HTTP header. Both carry the same rules with the same meaning. The rule names below are the ones Google Search documents; other search engines support overlapping but not identical sets, and each engine's own documentation is the authority for what it honors.

HTML
<meta name="robots" content="noindex, nofollow">
In the head of an HTML page
HTTP
HTTP/1.1 200 OK
Content-Type: application/pdf
X-Robots-Tag: noindex, nofollow
The same rules as a response header

Rule names and the name and content attributes are case-insensitive. Several rules can go in one comma-separated list or in separate meta elements or headers.

Rules Google Search supports

Indexing and serving rules in Google's robots meta tag documentation, December 2026
RuleEffect
allNo restrictions. This is the default, and listing it changes nothing.
noindexDo not show the page, media or resource in search results.
nofollowDo not follow the links on the page.
noneThe same as noindex, nofollow.
nosnippetShow no text snippet or video preview for the page. A static image thumbnail may still appear.
indexifembeddedAllow the content to be indexed when it is embedded in another page through an iframe or similar element, despite noindex. Has an effect only together with noindex.
max-snippet: numberUse at most this many characters for a text snippet. 0 means no snippet, like nosnippet; -1 lets the search engine choose.
max-image-preview: settingLargest image preview: none, standard, or large (up to the width of the viewport).
max-video-preview: numberUse at most this many seconds of video as a preview. 0 allows at most a static image; -1 means no limit.
notranslateDo not offer a translation of the page in search results.
noimageindexDo not index the images on the page.
unavailable_after: dateStop showing the page after this date and time, given in a widely used format such as RFC 822, RFC 850 or ISO 8601. An unparseable date makes the rule ignored.

Google lists noarchive, nocache and nositelinkssearchbox as historical values that Google Search no longer uses. They do no harm, and other search engines may still read them.

HTML
<meta name="robots" content="max-snippet:120, max-image-preview:large">
A short snippet and a large image preview
HTML
<meta name="robots" content="unavailable_after: 2027-03-31T23:59:59+00:00">
A page about a time-limited event

Rules for one crawler

The name attribute robots addresses every crawler. Replacing it with a crawler's token addresses only that crawler. Google reads two tokens in meta elements, googlebot for text results and googlebot-news for news results, and ignores others. In a header, the token goes before the rules, followed by a colon; a header without a token applies to every crawler.

HTML
<meta name="robots" content="nofollow">
<meta name="googlebot-news" content="nosnippet">
HTTP
X-Robots-Tag: googlebot: noindex
X-Robots-Tag: otherbot: noindex, nofollow

When rules conflict, the more restrictive one applies: max-snippet:50 together with nosnippet means no snippet. When a general rule and a crawler-specific rule both apply to a crawler, it combines their negative rules. Googlebot reading the first example above treats the page as nofollow, and a page with robots set to nofollow and googlebot set to noindex is treated by Googlebot as noindex, nofollow.

Keeping part of a page out of snippets

The data-nosnippet attribute marks text that may not appear in a snippet while the rest of the page can. Google supports it on span, div and section elements only. It is a boolean attribute: any value, including "false", is ignored and the content is still excluded. The markup must be valid, because an unclosed div would carry the exclusion to the end of the document.

HTML
<p>The API returns results in pages of 50.
<span data-nosnippet>Internal rate-limit thresholds are not published.</span></p>
<section data-nosnippet>
  <h2>Account-specific notes</h2>
  <p>Text that should not be quoted in search results.</p>
</section>

Google may extract the attribute before or after rendering a page, so it should be present in the HTML the server sends rather than added later by a script.

Files without a head: X-Robots-Tag

A PDF, an image, a plain text file or a Markdown copy of a page has nowhere to put a meta element. The header is the only way to give those files indexing rules, and it is usually set in server configuration by file type. These examples keep PDFs and Markdown copies out of search results while leaving HTML pages alone.

Apache
<FilesMatch "\.(pdf|md)$">
  Header set X-Robots-Tag "noindex"
</FilesMatch>
Apache, in the server configuration or an .htaccess file (requires mod_headers)
Nginx
location ~* \.(pdf|md)$ {
  add_header X-Robots-Tag "noindex";
}
nginx, inside the server block

Before adding noindex to Markdown copies, consider a canonical Link header instead, which tells search engines which URL is the original without removing anything; see canonical and alternate links. To check what a server sends, request the file with curl -sI and look for the header.

The rule must be crawled to be seen

A search engine learns a page's rules only by fetching the page. If robots.txt disallows the URL, the crawler never sees the meta element or header, and a noindex there has no effect. A disallowed URL can still appear in results, usually without a snippet, when other pages link to it. To keep a page out of the index, leave it crawlable and mark it noindex; to stop it being fetched at all, use robots.txt and accept that its address may still be listed. The difference is explained further in what robots.txt does not do.

Other search engines

The robots meta tag was in use long before today's search engine documentation, and support for the newer values varies from engine to engine. Bing's help pages name a noindex robots meta tag as one of the ways to remove a page from its index. For any rule other than noindex and nofollow, check the documentation of each search engine whose results matter to the site.

See also

  • robots.txt syntax: groups, rules and matchingReference for the robots.txt file format as standardized in RFC 9309: groups and user-agent lines, allow and disallow rules, the * and $ characters, comments, and the longest-match rule that decides which line applies to a URL.
  • What robots.txt does not dorobots.txt asks crawlers not to fetch URLs. It does not protect content, hide paths, keep URLs out of search results or, for Google, carry noindex and crawl-delay rules. What to use for each of those instead.
  • Canonical and alternate linksA canonical link names the preferred URL when the same content is reachable at several addresses; alternate links point to translations and to the same page in other formats, such as JSON or Markdown. Both can be written in the HTML head or sent as HTTP Link headers.
  • Usage preferences beyond allow and disallowAllow and disallow say whether a URL may be fetched. A newer set of signals says how fetched content may be used, for search, as input to AI answers or for training: operator tokens such as Google-Extended, Cloudflare's Content-Signal line, and the IETF AI Preferences drafts.
  • Markdown versions of pages and llms-full.txtThe llms.txt proposal asks sites to offer a clean Markdown copy of useful pages at the page's own URL with .md added, and to announce it with standard link relations. llms-full.txt, a single file holding a whole site, is a platform convention outside the proposal.

References

  1. Google Search Central. Robots meta tag, data-nosnippet, and X-Robots-Tag specifications. developers.google.com (accessed 5 December 2026)
  2. Google Search Central. How Google interprets the robots.txt specification. developers.google.com (accessed 5 December 2026)
  3. Bing Webmaster Tools help. How to permanently remove a URL or page from Bing. bing.com (accessed 5 December 2026)
  4. Apache HTTP Server documentation. mod_headers. httpd.apache.org
  5. nginx documentation. Module ngx_http_headers_module. nginx.org