INSIDEA

data-nosnippet: How to Keep Text Out of Google Snippets and AI Overviews

Pratik Thakker
Pratik Thakker
CEO and Founder
··Updated October 24, 2026·8 min read
Share

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 wantMarkupValid 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 togetherWrap 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 div pulling 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, span or section that 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 nosnippet rule and data-nosnippet, nosnippet takes 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

ControlWhere it goesWhat it doesScope
data-nosnippetAttribute on a span, div or sectionKeeps the marked text out of snippetsPart of a page
nosnippetRobots meta tag or X-Robots-Tag headerNo text snippet or video preview, and no use as direct input for AI Overviews and AI ModeWhole page
max-snippet:[number]Robots meta tag or X-Robots-Tag headerCaps snippet length in characters and limits direct input for AI Overviews and AI Mode. 0 equals nosnippet and -1 means no limitWhole page
noindexRobots meta tag or X-Robots-Tag headerDrops the page from search resultsWhole page
robots.txt disallowrobots.txt fileStops crawling, but the URL can still appear without a descriptionURLs or folders
Google-Extendedrobots.txt user-agent tokenLimits use in Gemini model training and grounding outside Search, with no effect on SearchSite 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

  1. Open the post in the block editor.
  2. Click the Block Inserter icon and add a Custom HTML block, or type /html in a new paragraph block and press Enter.
  3. Click Edit HTML, paste your markup (for example, <div data-nosnippet><p>Your text</p></div>), check the preview, and click Update.
  4. 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

  1. Check your own HTML. View the page source and confirm the attribute sits on a span, div or section and that every tag is closed.
  2. 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.
  3. Request a recrawl. Click Request indexing. Google notes that a request does not guarantee indexing and that there is a daily limit on requests.
  4. 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.
  5. 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 div unclosed, 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.

Frequently asked questions.

What is data-nosnippet?

data-nosnippet is an HTML attribute that tells Google not to use the marked text as a search result snippet. Google supports it on span, div and section elements and treats it as a boolean, so any value is ignored. Bing also supports it for Bing Search snippets and Copilot answers.

What is nosnippet?

nosnippet is a page-level robots rule, set with a robots meta tag such as meta name="robots" content="nosnippet" or an X-Robots-Tag header. Google says it stops a text snippet or video preview for the page in all search results, including AI Overviews and AI Mode, and prevents the content from being used as a direct input for them. If a page has both nosnippet and data-nosnippet, nosnippet takes priority.

How do I use data-nosnippet in Google?

Wrap the text in a span, div or section element with the attribute, for example a span with data-nosnippet around a few words, or a div around a whole block. Make sure the HTML is valid with closed tags, and add the attribute in the page source rather than with JavaScript after load. Then use URL Inspection in Search Console to check the crawled HTML and request a recrawl.

Does data-nosnippet hide content from AI Overviews?

Google lists data-nosnippet with nosnippet, max-snippet and noindex as the controls for limiting what your pages show in Search, which includes AI Overviews and AI Mode. Google's specification only explicitly says nosnippet and max-snippet govern use as a direct input for those features, so use nosnippet if you need the whole page excluded. It does not affect ChatGPT, Perplexity or AI training.

Does data-nosnippet hurt rankings?

Bing says content marked with data-nosnippet is still indexed and available for ranking. Google's documentation treats it only as a snippet control and does not say it changes indexing, so the page stays eligible to appear in results. To remove a page from results, Google's rule is noindex.

Pratik Thakker
Pratik Thakker
CEO and Founder

Pratik Thakker is the CEO and Founder of INSIDEA, an Elite HubSpot Partner rated 4.99 across 500+ verified reviews. With 15+ years of experience, he helps businesses scale through AI-powered digital marketing, intelligent marketing systems, and data-driven growth strategies. He has supported 1,500+ businesses worldwide and is recognized in the Times 40 Under 40.

Connect on LinkedIn →

Want this applied to your business?

Book a strategy call. 30 minutes, real working session, written one-pager delivered after.

Get Started
With Us

Book a demo and discovery call to get a look at:

How INSIDEA works
The subscription plan that best fits your needs
Pricing, onboarding, and anything else
HubSpotSalesforcePipedriveAircallApolloTrustpilot

Book a Call With Us

By clicking Book a strategy call, you agree to receive communications from INSIDEA in accordance with our Privacy Policy.