WebmasterID logoWebmasterID
Robots & crawl control

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.

Verified against primary sources

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.

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

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

Sources and verification notes

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.