What it is for
"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."
That is the difference from nosnippet in one sentence. The robots rule governs the whole page and reaches every result type. This attribute governs a passage, and everything outside it stays eligible. Typical use is a boilerplate disclaimer, a price that changes hourly, or a line that reads badly out of context.
It is boolean, and that is where people get caught
"The data-nosnippet is considered a boolean attribute. As with all boolean attributes, any value specified is ignored."
The documentation's own examples spell out what that means:
<div data-nosnippet>not in snippet</div>
<div data-nosnippet="true">also not in snippet</div>
<div data-nosnippet="false">also not in snippet</div>
There is no off value. Writing data-nosnippet="false" excludes the section exactly as firmly as writing nothing after the attribute name. The only way to switch it off is to remove the attribute.
This is a plausible way to lose a snippet without noticing. A template that renders data-nosnippet={someFlag} will emit the attribute whenever the flag is present at all, and a false flag reads as an instruction rather than an exemption.
The attribute is boolean. Any value written after it is ignored, including the one that looks like an off switch.
There is no off value. The only way to switch the
attribute off is to remove it. A template that renders
data-nosnippet={flag} emits the attribute whenever the flag is
present at all, so a false flag still excludes the section.
An unclosed tag takes the rest of the page with it
"To ensure machine-readability, the HTML section must be valid HTML and all appropriate tags must be closed accordingly."
The example beneath it is blunt about the consequence: an unclosed div "will include all content afterwards". Mark one paragraph, forget the closing tag, and everything from there to the end of the document is excluded from your snippet.
Nothing about this shows up as an error. The page still validates in most people's eyes, still ranks, still gets crawled. The snippet simply gets shorter or stops appearing, which is the kind of change that gets blamed on Google.
Only three elements count
span, div, section. The documentation marks anything else invalid, using a custom tag as its counterexample:
<mytag data-nosnippet>some text</mytag>
If your framework renders custom elements, Google's instruction is to wrap or render them with div, span or section when you need the attribute.
Do not move it with JavaScript
"Google typically renders pages in order to index them, however rendering is not guaranteed. Because of this, extraction of data-nosnippet may happen both before and after rendering. To avoid uncertainty from rendering, do not add or remove the data-nosnippet attribute of existing nodes through JavaScript."
Two extraction points, one page, no guarantee which one applies. Toggling the attribute at runtime means the outcome depends on when Google looked, which is not something you can test reliably from your side. Where elements are added through JavaScript, the documentation says to include the attribute as the element first enters the DOM rather than adding it later.
Structured data is not covered
"Also note that structured data remains usable for search results when declared within a data-nosnippet element."
Wrapping a block does not seal it. If the same fact sits in JSON-LD inside that block, it stays available for search presentation. This matters most in the cases the attribute is usually reached for: prices, ratings, availability. Those are exactly the fields that also live in structured data, and marking the visible copy does nothing to the machine-readable one.
To withhold them, change the structured data itself.
What Google does not say about it
nosnippet and max-snippet both carry a clause about AI: they prevent or limit use of the content as a direct input for AI Overviews and AI Mode. The data-nosnippet section carries no such clause.
We checked rather than assumed. "AI Overviews" appears four times on that documentation page, and all four sit inside the definitions of nosnippet and max-snippet. Not one is in the section describing this attribute.
Read that for exactly what it is. Google does not say section-level exclusion keeps a passage out of AI answers, and it does not say the opposite either. If your reason for reaching for this attribute is AI rather than snippet appearance, you are acting on an assumption the documentation does not support.
What to do with it
Use it for passages, not for pages. If you want the whole page out, the page-level rule is the honest instrument.
Never write a value. data-nosnippet alone. Any value at all reads as on, and ="false" is the trap.
Check the closing tag every time. The failure is silent and it runs to the end of the document.
Look at your structured data in the same pass. Otherwise the fact you hid is still published.
Do not treat it as an AI control. The documentation attaches that effect to nosnippet and max-snippet, and says nothing here.
Source
- Google Search Central, "Robots meta tag, data-nosnippet, and X-Robots-Tag specifications" (retrieved 3 September 2026 and again 15 September 2026, page dated "Last updated 2026-03-24 UTC"): https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag. Source of every passage quoted here: the definition and the three permitted elements, the boolean-attribute sentence, the three code examples including
="false", the requirement that tags be closed and the note that an uncloseddivincludes all content afterwards, the custom-element counterexample, the paragraph on rendering and JavaScript, and the sentence on structured data inside adata-nosnippetelement. - The statement that Google attaches no AI clause to this attribute was checked rather than assumed: "AI Overviews" occurs four times on the page, all four inside the definitions of
nosnippetandmax-snippet, counted in the retrieved text with "snippet" (45 occurrences) as a control term confirming the retrieval was intact. - Google Search Console Help, "Search generative AI control" (retrieved 15 September 2026; the page states the control was rolled out to all websites on August 31, 2026): https://support.google.com/webmasters/answer/16908024. Source of the site-wide setting mentioned in the FAQ.
Frequently asked questions
Can I turn data-nosnippet off with ="false"?
No. It is a boolean attribute and any value specified is ignored. The documentation's own example shows ="false" still excluding the section. Remove the attribute instead.
Which elements accept it?
span, div and section. A custom element is invalid for this purpose; wrap it in one of the three.
Does it keep the marked text out of AI Overviews?
Google does not say. The AI clause appears in the definitions of nosnippet and max-snippet, and not in the section on this attribute. For a whole site, Search Console has a separate setting, available to all websites since 31 August 2026, that excludes it from AI Overviews and AI Mode.
Will my structured data still be used inside a marked block?
Yes. The documentation states that structured data remains usable for search results when declared within a data-nosnippet element.
