How do noindex, nosnippet, data-nosnippet, max-snippet and X-Robots-Tag control what Google shows?

Google documents page-level rules (the robots meta tag and the X-Robots-Tag header) and a text-level attribute (data-nosnippet) to control how content is shown in Search. These rules only work if Google can crawl the URL.

Verified against the sources on 2026-10-23. Labels: Proven means the primary source we opened states it. Practice means widely used practice or secondary reporting that the primary source does not confirm. Experimental means a proposal or draft.

Which controls exist?

  • Proven Google’s control page lists removing content, password protection, a noindex rule, robots.txt disallow (images and video only), the robots meta tag with data-nosnippet and X-Robots-Tag, a site-wide Search generative AI control in Search Console, and opting out of specific Google properties.
  • Proven The page gives three reasons to use them: restricting data, hiding low-value content, and helping Google focus crawling on important pages of very large sites.

What do the main rules do?

  • Proven noindex means do not show the page, media or resource in results.
  • Proven nosnippet means no text snippet or video preview; a static image thumbnail may still appear. Google says it also prevents use as direct input for AI Overviews and AI Mode.
  • Proven max-snippet:[number] caps the text snippet in characters; 0 equals nosnippet and -1 lets Google choose. It does not affect image or video previews.
  • Proven max-image-preview takes none, standard or large; max-video-preview takes a number of seconds.
  • Proven unavailable_after hides a page after a given date; noarchive, nocache and nositelinkssearchbox are ignored by Google Search.

How do the tag, header and attribute differ?

  • Proven The robots meta tag goes in the page head; name="robots" applies to all crawlers; googlebot applies to all text results (googlebot-news to news results).
  • Proven X-Robots-Tag is an HTTP header that accepts the same rules and is the option for non-HTML files such as PDFs, images and video. A user agent can prefix the rules.
  • Proven data-nosnippet works on span, div and section elements, is a boolean attribute, and needs valid, closed tags. Do not add or remove it with JavaScript on existing nodes.
  • Proven When rules conflict, the more restrictive applies; for example nosnippet overrides max-snippet:50.

What can stop these rules from working?

  • Proven A rule is discovered only when the URL is crawled. If robots.txt blocks a URL, its indexing and serving rules are ignored.
  • Proven max-snippet does not limit rich results powered by structured data, except for structured data description values, which max-snippet can limit; to control those, edit the structured data.

What this page does not cover

  • Removal of content already in results is covered on a separate Google page not summarised here.
  • How quickly a changed rule takes effect varies; the AI features page says recrawling can take days to months.
  • The documentation can change; check the primary pages for current directive lists.

Sources

  1. Robots meta tag, data-nosnippet, and X-Robots-Tag specifications – Google Search Central
  2. Control what you share with Google – Google Search Central
  3. AI features and your website – Google Search Central

Related guides