data-nosnippet is an HTML attribute you put on a span, div or section element to tell Google not to use the text inside it as a snippet in search results. The page can still rank and be shown. Only the marked words are kept out of the short text under the title, and Google says the same preview rules now reach its AI answers too.
What is data-nosnippet? #
A snippet is the bit of text Google shows below a result on the results page. Google’s snippet guide says snippets are created automatically from the page content, and that it may use your meta description when that sums the page up better. data-nosnippet lets you fence off parts of the page so they never become that text. Google announced it on 24 September 2019, together with the max-snippet, max-image-preview and max-video-preview rules.
The name looks odd because it borrows the HTML custom data format. MDN explains that data-* attributes carry your own information between the HTML and scripts. Browsers ignore it. Google’s crawler reads it as an instruction.
What does it look like? #
<p>Our kettle costs £39.99.
<span data-nosnippet>Trade price: ask our team.</span></p>
<div data-nosnippet>
<p>Customer comment: "arrived late, but works well."</p>
</div>
The first line can appear in a snippet. The trade price line and the whole comment block cannot.
How is it different from nosnippet and max-snippet? #
All three live in Google’s robots meta tag rules, but they work at different sizes.
| Rule | Where it goes | What it does |
|---|---|---|
| nosnippet | Meta robots tag or X-Robots-Tag header | No text snippet or video preview for the whole page |
| max-snippet:[number] | Meta tag or header | Caps the snippet at that many characters; 0 means no snippet, -1 lets Google choose |
| data-nosnippet | On a span, div or section in the page body | Keeps only the marked parts out of snippets |
| noindex | Meta tag or header | Keeps the whole page out of results |
Use data-nosnippet when most of the page is fine to quote and only a few lines are not.
Why does it matter for search? #
A snippet sells the click. If Google lifts a cookie notice, a stock warning or an old delivery date into your result, fewer people will choose it, and your click-through rate drops. Marking that boilerplate with data-nosnippet pushes Google towards the text you want people to read. It does not change ranking: the page is still crawled and indexed. Google also says structured data inside a data-nosnippet element can still be used for search results, so your JSON-LD keeps working.
Why does it matter for AI answers? #
Google’s robots meta tag page says the nosnippet rule applies to all forms of search results and also stops the content being used as a direct input for AI Overviews and AI Mode. It says max-snippet limits AI input in the same way. Its guide to AI features and your website lists nosnippet, data-nosnippet, max-snippet and noindex together as the controls that limit what is shown from your pages in Search. So data-nosnippet is the fine tool for keeping one passage out of a Google AI answer while the rest of the page stays quotable.
It is a Google rule. It does not block AI training, and it says nothing to other companies’ AI crawlers. For Google’s training and grounding outside Search, Google points to Google-Extended instead. Our guide should I block AI crawlers? covers the wider choice.
How does it work? #
- Only three elements. Google accepts it on span, div and section. On a p, li or custom element it is not valid. Wrap custom elements in one of the three.
- It is a boolean attribute. Any value is ignored. data-nosnippet=”false” still hides the text.
- The HTML must be valid. Google warns that an unclosed div can make the rest of the page count as excluded.
- Rendering is not promised. Google may read the page before and after rendering, so do not add or remove the attribute on existing nodes with JavaScript. If a script builds a new element, give it the attribute when it is first added to the DOM.
- Google must be able to crawl. The rules are only read if Googlebot may fetch the page. A robots.txt block means the rule is never seen.
Common mistakes #
- Putting it on a paragraph. <p data-nosnippet> does nothing. Use a span inside it, or a div around it.
- Thinking it hides text from people. Visitors still see everything. It is not a privacy tool. Remove secret details from the page.
- Thinking it hides text from Google. The words are still crawled and indexed. They just will not be quoted as a snippet.
- Wrapping the whole page. If every word is marked, use the nosnippet meta rule instead, and accept a bare result.
- Toggling it with a script. See the rendering rule above; set it in the HTML your server sends.
- Expecting other engines to obey. The rule is documented by Google. Do not assume other search engines or AI tools follow it.
A worked example #
One UK online shop found its product results showing “Sorry, delivery may take 5 days this week” from a site-wide banner. The fix:
- Wrap the banner in <div data-nosnippet> … </div> in the theme template.
- Leave the product description and price outside the wrapper, so they can be quoted.
- Check the closing tag is in place, so the product text below is not swept in.
- Ask for a recrawl of a few key pages with URL Inspection in Google Search Console.
The banner still shows to shoppers. After Google recrawls, the snippet is drawn from the description instead.
How to check it #
- View the page source and find each data-nosnippet. Check it sits on span, div or section and that each one is closed. The HTML Formatter makes nesting easy to read.
- Run the address through our Meta Tag Checker to see any page-wide nosnippet or max-snippet rule that would override your careful markup.
- Check the HTTP Header Checker for an X-Robots-Tag header doing the same.
- Confirm Googlebot can reach the page with the Robots.txt Checker and the Indexability Checker.
- If the attribute is added by your front end, test with the JavaScript SEO Checker to see whether it is in the HTML before scripts run.
- Preview how the title and description read with the Google Snippet Preview.
- To see which passages an answer engine might lift, try the Answer Box Simulator. In URSY Pro, the AI Overview theft detector (Pro) is being built for this job.
Questions #
Does data-nosnippet stop a page ranking? #
No. It only controls snippet text. Use noindex to keep a page out.
Can I use it on an image? #
No. Images have their own rule, max-image-preview, set in the meta robots tag.
Does it stop featured snippets? #
Marked text cannot be used as a snippet, and a featured snippet is a snippet, so marked text should not be quoted there either.
Does it block AI training? #
No. It limits what Google shows in Search, including AI Overviews and AI Mode. Training controls are separate.
Related words #
Sources #
- Google Search Central: Robots meta tag, data-nosnippet and X-Robots-Tag specifications, checked 25 November 2026
- Google Search Central: Control your snippets in search results, checked 25 November 2026
- Google Search Central: AI features and your website, checked 25 November 2026
- Google Search Central Blog: More options to help websites preview their content on Google Search (24 September 2019), checked 25 November 2026
- MDN: data-* global attributes, checked 25 November 2026
Updated 25 November 2026 by URSY.
Cite this page: data-nosnippet. URSY. Updated 25 November 2026. https://ursy.com/wiki/data-nosnippet/ · Section links
Tools for this
- LiveIs your site in Common Crawl (a main source of AI training data)?Run the check →
- LiveSchema Markup CheckerRun the check →
- LiveSchema Markup GeneratorFAQ, product, local business, organisation, article, breadcrumb, event, recipe or videoRun the check →
- ProBing keywordsBing Webmaster dataIn URSY Pro →
- ProStructured data monitorSchema errors, site-wideIn URSY Pro →