data-nosnippet is an HTML attribute that tells Google not to use the marked text in a search result snippet, while the rest of the page can still be shown. You add it to a span, div or section element, for example <span data-nosnippet>this text stays out of the snippet</span>, and Google ignores any value you give it.
Checked against Google Search Central documentation and the Bing Webmaster Blog on October 20, 2026.
The attribute is a preview control. It changes what Google and Bing may quote from your page, not whether the page is indexed. That makes it useful for keeping disclaimers, boilerplate, paywalled text or sensitive details out of results, and less useful as a general shield against AI, which is how it is often described.
What is data-nosnippet?
Google describes two kinds of snippet controls. Page-level rules, such as nosnippet and max-snippet, go in a robots meta tag or an X-Robots-Tag HTTP header and apply to the whole page. The text-level control is data-nosnippet, an attribute you place on HTML elements inside the page to mark the parts that should not be used as a snippet.
A snippet is the description part of a search result. Google's snippet documentation says snippets are created automatically, mainly from page content, and can differ from one search to the next. data-nosnippet lets you take specific passages out of the pool Google can draw from.
Bing added support on October 15, 2025. Its announcement says marked content is excluded from Bing Search snippets and from AI-generated answers in Copilot experiences powered by Bing.
data-nosnippet syntax and supported elements
Google's robots meta tag specification says the attribute works on span, div and section elements. It is a boolean attribute, so data-nosnippet, data-nosnippet="true" and even data-nosnippet="false" all mean the same thing: the text is excluded.
| What you want | Markup | Valid for Google? |
|---|---|---|
| Hide part of a sentence | <p>Shown text <span data-nosnippet>hidden text</span>.</p> | Yes |
| Hide a block | <div data-nosnippet>hidden block</div> | Yes |
| Hide a whole section | <section data-nosnippet>hidden section</section> | Yes |
| Hide a paragraph and a list together | Wrap the p and ul inside one <div data-nosnippet> | Yes |
| Put the attribute on a paragraph | <p data-nosnippet>text</p> | No, p is not a supported element |
| Put the attribute on a list item | <li data-nosnippet>text</li> | No, wrap the content in a span or div |
| Custom element | <mytag data-nosnippet>text</mytag> | No, Google marks this as not valid |
| Unclosed tag | <div data-nosnippet>text with no closing </div> | Risky, everything after it is treated as inside |
If you want to hide a single paragraph, wrap it: <div data-nosnippet><p>Your paragraph</p></div>. If you want to hide a few words inside a paragraph, use a span around those words.
Bing's announcement says the attribute can go on any HTML element. Google is stricter, so stick to span, div and section and the same markup works for both.
Google's rules for using it correctly
The specification adds a few conditions that are easy to miss:
- Valid HTML only. Google says the section must be valid HTML with all tags closed. Its own example shows an unclosed
divpulling in all the content after it. - Do not toggle it with JavaScript. Google may read data-nosnippet before or after rendering, so it says not to add or remove the attribute on existing nodes with JavaScript. If your script creates new elements, include the attribute when the element is first added to the page.
- Wrap custom elements. If you use web components or other custom elements, render them inside a
div,spanorsectionthat carries the attribute. - Structured data still counts. Google says structured data stays usable for search results even when it is declared inside a data-nosnippet element.
- Crawlers must reach the page. Google reads these settings only if its crawlers are allowed to access the page, so a robots.txt block means the attribute is never seen.
- nosnippet wins. Google's featured snippet guide says that if a page has both the
nosnippetrule and data-nosnippet,nosnippettakes priority and no snippet is shown.
Does data-nosnippet keep text out of AI Overviews and AI Mode?
Google's guide to AI features in Search says that to limit the information shown from your pages in Search, you use nosnippet, data-nosnippet, max-snippet or noindex. AI Overviews and AI Mode are part of Search, so data-nosnippet is one of the named controls.
The wording is more explicit for the page-level rules. Google's specification says nosnippet applies to AI Overviews and AI Mode and also prevents the content from being used as a direct input for them, and that max-snippet limits how much content may be used as a direct input. For data-nosnippet, the specification itself talks only about snippets. So the safe reading is this: data-nosnippet is Google's documented way to limit what text from a page is shown, including in AI features, and nosnippet is the documented way to stop a whole page from being used as a direct input.
Google's featured snippet guide also confirms that text marked with data-nosnippet will not appear in featured snippets or regular snippets.
What data-nosnippet does not do
Keep expectations honest before you add it to important pages:
- It is not an indexing rule. noindex is the rule that removes a page from results. Bing says marked content is still indexed and available for ranking. Google's documentation describes data-nosnippet only as a snippet control and does not say it changes indexing.
- It does not block crawling. Googlebot still fetches the page. Use robots.txt to manage crawling.
- It does not stop AI training or grounding outside Search. Google points to Google-Extended, a robots.txt token, for limiting use in training future Gemini models and in grounding for Gemini Apps and Vertex AI. Google says Google-Extended does not affect inclusion or ranking in Google Search.
- It does not cover every AI assistant. Google and Bing document support. Other providers publish their own crawler controls. OpenAI, for example, lists OAI-SearchBot for ChatGPT search and GPTBot for model training, each managed in robots.txt, and its crawler page does not mention data-nosnippet.
- It does not hide text from people. Visitors still see everything on the page.
data-nosnippet vs nosnippet, max-snippet, noindex, robots.txt and Google-Extended
| Control | Where it goes | What it does | Scope |
|---|---|---|---|
| data-nosnippet | Attribute on a span, div or section | Keeps the marked text out of snippets | Part of a page |
| nosnippet | Robots meta tag or X-Robots-Tag header | No text snippet or video preview, and no use as direct input for AI Overviews and AI Mode | Whole page |
| max-snippet:[number] | Robots meta tag or X-Robots-Tag header | Caps snippet length in characters and limits direct input for AI Overviews and AI Mode. 0 equals nosnippet and -1 means no limit | Whole page |
| noindex | Robots meta tag or X-Robots-Tag header | Drops the page from search results | Whole page |
| robots.txt disallow | robots.txt file | Stops crawling, but the URL can still appear without a description | URLs or folders |
| Google-Extended | robots.txt user-agent token | Limits use in Gemini model training and grounding outside Search, with no effect on Search | Site or folders |
Page-level examples look like this: <meta name="robots" content="nosnippet">, <meta name="robots" content="max-snippet:50">, or as an HTTP header, X-Robots-Tag: nosnippet. Google's specification says that when rules conflict, the more restrictive one applies, so max-snippet:50 plus nosnippet results in no snippet.
How to add data-nosnippet
In plain HTML or a template
Edit the template or page source and wrap the text you want to hold back. Do it on the server or in the static HTML, not with a script that runs after the page loads. A template field, such as a "Hide from snippets" checkbox that wraps a block in <div data-nosnippet> when the page is rendered, follows Google's rules because the attribute is present in the delivered HTML.
In WordPress
- Open the post in the block editor.
- Click the Block Inserter icon and add a Custom HTML block, or type
/htmlin a new paragraph block and press Enter. - Click Edit HTML, paste your markup (for example,
<div data-nosnippet><p>Your text</p></div>), check the preview, and click Update. - Publish, then view the page source to confirm the attribute is there.
WordPress documentation says Custom HTML from users without the unfiltered_html capability, such as Contributors, is sanitized when the post is saved. If the attribute is missing from the published page, have an Editor or Administrator check the block.
In a headless CMS
Add a boolean field to the content block model, and have the front end render the block inside <div data-nosnippet> when the field is on. Because the decision happens at render time, the attribute is in the HTML Google receives.
How to test data-nosnippet
- Check your own HTML. View the page source and confirm the attribute sits on a
span,divorsectionand that every tag is closed. - See what Google received. In Search Console, paste the URL into the inspection bar at the top, then click View crawled page to see the HTML Googlebot fetched. Use Test live URL to check the current version.
- Request a recrawl. Click Request indexing. Google notes that a request does not guarantee indexing and that there is a daily limit on requests.
- Wait, then check results. Google's AI features guide says crawling can take anywhere from several days to several months, depending on how often its systems refresh a page. Search a query where the old snippet appeared and see whether the marked text is gone.
- Check Bing too. Bing suggests using URL Inspection in Bing Webmaster Tools to see the last crawl time, and says changes can take from a few seconds to up to a week to show.
If the text still shows, recheck the element type, closing tags and whether a script adds the attribute after load. All three come straight from Google's rules.
When to use it, and when to leave it off
Good candidates:
- Legal disclaimers, cookie notices or boilerplate that Google keeps pulling into your snippet.
- Paywalled or members-only text that is visible on the page.
- Sensitive details you are happy to show visitors but not in a search preview.
- Comments or user reviews that read poorly out of context.
Think twice before hiding your clearest answer. Text Google cannot show is text it cannot quote, so marking your best explanation may reduce how often that passage appears or is linked in AI Overviews and featured snippets. Measure before and after. Google says AI Overviews and AI Mode traffic is counted in the Search Console Performance report under the Web search type, so compare clicks and click-through rate for the affected queries over the same number of weeks on each side of the change.
For example, imagine a hypothetical software company whose pricing page snippet keeps showing a long legal disclaimer instead of its plan summary. It wraps the disclaimer in <div data-nosnippet>, requests a recrawl in URL Inspection, and a few weeks later compares click-through rate for its pricing queries. The disclaimer is still on the page for visitors, but the summary now has a better chance of being used as the snippet.
Common mistakes
- Using
<p data-nosnippet>or<li data-nosnippet>, which Google does not support. - Leaving a
divunclosed, which can hide everything after it. - Adding the attribute with JavaScript after the page loads.
- Expecting it to stop ChatGPT, Perplexity or AI training.
- Using noindex or a robots.txt block when you only wanted to hide one passage.
- Blocking the page in robots.txt, which stops Google from ever reading the attribute.
For more on how snippets are chosen, see our guide to optimizing content for featured snippets, and to measure the effect of any change, see how to track Google AI Overviews and citations.
Getting help with AI search visibility
INSIDEA is an Elite HubSpot Partner and the growth operating system for modern businesses. If you want help deciding which passages to show, which to hold back, and how to measure the result in AI search, our growth marketing team can work through it with you.



