data-nosnippet and the three page-level snippet controls

data-nosnippet is the only one of Google's four snippet controls that works on part of a page. This is what each of the four does, which two also limit AI Overviews and AI Mode, and why most sites should use none of them.

Crawling & Indexing8 min read2078 views
data-nosnippet and the three page-level snippet controls

Four rules decide how much of a page Google may quote, and the data-nosnippet HTML attribute is the only one of them that works on part of a page instead of all of it. The other three — nosnippet, max-snippet:[number] and max-image-preview — are page-level robots rules. Two of the four also limit what AI Overviews and AI Mode may use as direct input, and they do it by taking away your ordinary search snippet at the same time. There is no documented way to have one without the other.

Before you read this

These are serving rules, not indexing rules. They do not remove a page from the index and they do not stop it being crawled; if that is what you want, the decision is when to noindex a page instead. This chapter assumes the page should stay in Search and the question is only how much of it may be shown.

The four controls, in Google's own words

All quotes below are from Robots meta tags, data-nosnippet, and X-Robots-Tag specifications, retrieved 2026-08-28.

RuleScopeWhat it stops
nosnippetWhole pageText snippet and video preview
max-snippet:[n]Whole pageSnippet longer than n characters
data-nosnippetOne elementThat element's text only
max-image-previewWhole pageImage preview above a size

nosnippet means "Do not show a text snippet or video preview in the search results for this page", with one carve-out you should expect: "A static image thumbnail (if available) may still be visible, when it results in a better user experience."

max-snippet:[number] takes an integer and has two special values worth memorising. Zero means "No snippet is to be shown. Equivalent to nosnippet", and -1 means "Google will choose the snippet length that it believes is most effective". The rule is also fragile in a specific way: "This rule is ignored if no parseable [number] is specified." A typo does not fail loudly; it just does nothing.

Where AI surfaces enter the wording

This is the part worth reading twice, because the four rules are not described identically. For nosnippet, Google writes that it "applies to all forms of search results (at Google: web search, Google Images, Discover, AI Overviews, AI Mode) and will also prevent the content from being used as a direct input for AI Overviews and AI Mode". For max-snippet, the same construction appears: it "will also limit how much of the content may be used as a direct input for AI Overviews and AI Mode".

For max-image-preview, the list reads "(such as Google web search, Google Images, Discover, Assistant)" and stops there. AI Overviews and AI Mode are not named. That is an observation about the wording, not a claim that the rule does not reach those surfaces — "such as" makes the list open — and Google does not say either way.

Both text rules carry the same exception, and it is the one people get wrong: the limit "does not apply in cases where a publisher has separately granted permission for use of content. For instance, if the publisher supplies content in the form of in-page structured data or has a license agreement with Google, this setting does not interrupt those more specific permitted uses."

A snippet rule limits what Google takes from your prose. It does not limit what you handed over in structured data.

Spelled out elsewhere on the same page: "Robots meta tag limitations don't affect the use of that structured data, with the exception of article.description and the description values for structured data specified for other creative works." So a page carrying max-snippet:0 and a rich recipe markup has not withheld the recipe.

Using the data-nosnippet HTML attribute

It is the surgical one. "You can designate textual parts of an HTML page not to be used as a snippet. This can be done on an HTML-element level with the data-nosnippet HTML attribute on span, div, and section elements."

Three properties of it decide whether your implementation works.

  1. It is boolean. "As with all boolean attributes, any value specified is ignored" — Google's own examples show data-nosnippet="true" and data-nosnippet="false" behaving identically, both excluded. Writing false to re-enable a snippet does the opposite of what it looks like.
  2. It only works on three elements. Google's example marks <mytag data-nosnippet> as NOT VALID because it is "not a span, div, or section". A custom element wrapper silently does nothing.
  3. The HTML has to be valid. "To ensure machine-readability, the HTML section must be valid HTML and all appropriate tags must be closed accordingly" — an unclosed div "will include all content afterwards", which is how one price disclaimer removes the rest of the page from every snippet.

There is also a rendering rule that catches single-page applications: "To avoid uncertainty from rendering, do not add or remove the data-nosnippet attribute of existing nodes through JavaScript. When adding DOM elements through JavaScript, include the data-nosnippet attribute as necessary when initially adding the element to the page's DOM." Extraction "may happen both before and after rendering", so a toggled attribute has two possible readings and you do not control which one is used.

Deliverable: the blocks and the decision table

Page-level rules go in the <head>, or in an X-Robots-Tag header if you cannot edit the HTML:

<!-- no text snippet at all -->
<meta name="robots" content="nosnippet">

<!-- at most 20 characters -->
<meta name="robots" content="max-snippet:20">

<!-- no limit, and a large image preview -->
<meta name="robots" content="max-snippet:-1, max-image-preview:large">

Element-level exclusion, on the three permitted elements only:

<p>This sentence can be quoted
  <span data-nosnippet>and this clause cannot</span>.</p>

<div data-nosnippet>
  <p>Internal note, never shown in a snippet.</p>
</div>
You want toUseWhat it costs
Hide one clausedata-nosnippetNothing else on the page
Cap quoted lengthmax-snippet:[n]Your normal snippet is capped too
Withhold the textnosnippetThe whole search snippet
Shrink image previewsmax-image-previewThumbnail size in results
Leave the indexnoindexAll search traffic

The trap that makes all four disappear

Blocking the page in robots.txt deletes the rule you just wrote. Google's page states the mechanism directly: "robots meta tags and X-Robots-Tag HTTP headers are discovered when a URL is crawled. If a page is disallowed from crawling through the robots.txt file, then any information about indexing or serving rules will not be found and will therefore be ignored."

The order is the whole point. A rule that limits what may be shown has to be fetched before it can be obeyed, so the page must stay crawlable. If you are unsure whether crawlers reach the page at all, check that first with the AI crawler accessibility check; a serving rule on an unreachable page is a rule nobody reads.

Verifying one of these is a two-minute job, and it is worth doing once per template rather than trusting a plugin's checkbox. Fetch the page the way a crawler would, look at the response headers for an X-Robots-Tag, and search the delivered HTML for name="robots". If the plugin writes the tag with JavaScript, neither will show it, and neither will Google on a first pass — the same rendering uncertainty that applies to data-nosnippet applies here.

When not to do this at all

Most sites should leave all four alone, and the reason is in the wording rather than in any measurement. The same directive that keeps your text out of an AI Overview keeps it out of the ordinary result. Google documents no way to permit one and refuse the other, so "stop AI from quoting me but keep my snippet" is not currently a setting — it is a wish.

Three situations where reaching for them is defensible: content you license to someone else and may not republish in full; a paywalled or member-only excerpt where the visible fragment is the product; and boilerplate that keeps winning the snippet over the paragraph you actually want quoted, which is the one case where data-nosnippet on a single element is clearly the right size of tool.

Stop rule: if you cannot name which specific text you are withholding and from whom, do not set any of these. A blanket nosnippet applied because AI answers feel unfair is a decision to show search users a result with no description, and that cost lands immediately while the benefit is unmeasurable from your side.

Where this stops

These rules describe what Google says it will do. They are not enforcement, they do not bind other crawlers unless those crawlers choose to honour them, and nothing here tells you what a given AI product does with text it already has. We also cannot tell you how much traffic a suppressed snippet costs — that number is site-specific, and we have not measured it. What the documentation does support is the shape of the trade, and the shape is: page-level control is coarse and expensive, element-level control is precise and cheap.

Common questions

Does nosnippet stop AI Overviews from using my page?

Google's page says it prevents the content "from being used as a direct input for AI Overviews and AI Mode", and in the same sentence that it applies to web search. Both effects come together. The background on why this directive matters more than an imagined opt-out is in there is no noai directive.

Is max-snippet:0 different from nosnippet?

Google's documentation calls 0 "Equivalent to nosnippet". The practical difference is failure mode: an unparseable number makes the whole rule ignored, while nosnippet has nothing to mistype.

Can I put data-nosnippet on a table cell or a list item?

No. The attribute is documented for span, div and section. Wrap the content in one of those three instead.

Do these rules affect other search engines?

Each engine publishes its own support. Treat the quotes here as Google's behaviour only; on the same 27-homepage panel we measured for meta robots tag, most sites ship no robots meta tag at all, which is the default and usually the right one.

Where should I put the rule if I cannot edit the page?

The X-Robots-Tag response header carries the same directives at the server or CDN layer. Same rules, same crawlability requirement.

Part of the QueryWin handbook · Level 3

data-nosnippet and the three page-level snippet controls