The data-nosnippet attribute explained
data-nosnippet is a Google-supported HTML attribute that marks portions of a page so they are not used in search snippets. This page explains how to apply it, which elements support it, and how it differs from the page-level nosnippet directive.
What data-nosnippet does
data-nosnippet is an HTML attribute Google recognises on span, div, and section elements. Any text wrapped in an element carrying the attribute is excluded from the text snippet Google generates for the page. Unlike the page-level nosnippet directive, it is surgical: the rest of the page can still produce a snippet.
It is a boolean attribute — its presence is what matters. Google reads it during indexing; it does not change how the page is crawled.
- Supported on span, div, and section elements
- Excludes only the wrapped text from snippets
- Boolean attribute — presence alone activates it
How to use it
Wrap the content you want kept out of snippets:
<p>Public summary. <span data-nosnippet>Hidden from snippet.</span></p>
The attribute does not affect indexing, ranking, or crawling — the page is still indexed and the protected text is still on the page for users. If you want to suppress the entire snippet, use the page-level nosnippet directive instead; if you want to keep the whole page out of the index, that is a different control (noindex).
How it appears in analytics and logs
data-nosnippet is an on-page HTML attribute, not a crawl signal, so it never appears in logs. Its effect is that the marked text is omitted from the snippet Google composes for the page.
Diagnostic use case
Keep a specific sentence or block — like a disclaimer or spoiler — out of Google's snippet while still allowing the rest of the page to generate a useful preview.
What WebmasterID can help detect
WebmasterID tracks crawler traffic rather than snippet rendering, but knowing data-nosnippet exists helps you keep snippet-control questions distinct from the bot-traffic signals WebmasterID reports.
Common mistakes
- Expecting data-nosnippet to noindex the page — it only affects snippet text.
- Applying it to unsupported elements and assuming it still works.
- Confusing the surgical attribute with the page-level nosnippet directive.
Privacy and accuracy notes
data-nosnippet governs how your own content is previewed. It involves no visitor data and is not an access-control mechanism.
Related pages
- The nosnippet robots directive explained
nosnippet is a Google robots directive that tells Google not to show any text snippet or video preview for a page in search results. This page explains where to set it, what it affects, and how it relates to the finer-grained max-snippet and data-nosnippet controls.
- max-snippet and preview directives explained
max-snippet, max-image-preview, and max-video-preview are Google robots directives that cap how much of your content appears in result-page previews. This page explains the values each accepts, where to set them, and how they differ from blocking indexing.
- The noindex meta tag
The noindex value of the meta robots tag tells search engines to keep a page out of their index. The catch trips people up constantly: for noindex to work, the crawler must be able to fetch the page — so you must not block the same URL in robots.txt.
- WebmasterID docs
How WebmasterID separates crawler signals from indexing policy.
Sources and verification notes
- Google — data-nosnippet attributeDocuments the data-nosnippet attribute and supported elements.
Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.