# data-nosnippet

> How the data-nosnippet attribute works: allowed elements, the HTML rules, the JavaScript gotcha, and how it relates to nosnippet, max-snippet and AI Overviews.

Canonical: https://scaplet.com/ai-search/data-nosnippet

Guide AI search · Guide

How the data-nosnippet attribute works: allowed elements, the HTML rules, the JavaScript gotcha, and how it relates to nosnippet, max-snippet and AI Overviews.

3 min

read

2

sources

Oct 23, 2026

updated

Scaplet Editorial Team

author

In one line

data-nosnippet is an HTML attribute that marks part of a page so Google won't use that text in a snippet. It works on span, div and section elements, and any value is ignored. Google's AI features page lists it among the controls for limiting the information shown from your pages in Search.

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fai-search%2Fdata-nosnippet%20(%22data-nosnippet%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fai-search%2Fdata-nosnippet%20(%22data-nosnippet%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fai-search%2Fdata-nosnippet%20(%22data-nosnippet%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fai-search%2Fdata-nosnippet%20(%22data-nosnippet%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

## At a glance

4 facts from the sources below

span, div, section

Allowed elements

Boolean (value ignored)

Attribute type

Part of a page

Scope

nosnippet, max-snippet, noindex

Related controls

_01_Check it

## What data-nosnippet does

Google's documentation says: "You can designate textual parts of an HTML page not to be used as a [snippet](/glossary/snippet)." You do that by adding the `data-nosnippet` attribute to the element that wraps the text. The rest of the page can still appear in a snippet.

It is a [robots meta tag](/glossary/robots-meta-tag) family control, but at section level. The page-level `nosnippet` rule tells Google not to "show a text snippet or video preview in the [search results](/glossary/serp) for this page." Use `data-nosnippet` when you only want to keep one block out of snippets, such as a price table, a members-only teaser or a quoted passage you license.

Google's example

```
<p>This text can be shown in a snippet <span data-nosnippet>and this part would not be shown</span>.</p>
```

_02_At a glance

## Rules that make it work

Rule

### Elements

What Google documents

`span`, `div` and `section`

Rule

### Attribute type

What Google documents

Boolean; as with all boolean attributes, any value specified is ignored, so `data-nosnippet="false"` still applies

Rule

### HTML

What Google documents

The section must be valid HTML and all appropriate tags must be closed. Google's example shows an unclosed `div` including all content after it. Wrap custom elements in a `div`, `span` or `section`

Rule

### JavaScript

What Google documents

Don't add or remove `data-nosnippet` on existing nodes with JavaScript; include it when you first add a new DOM element

Rule

### [Rendering](/glossary/rendering)

What Google documents

Extraction may happen both before and after rendering, because rendering is not guaranteed

**The false value trap**Because the attribute is boolean, writing `data-nosnippet="false"` does not turn it off. To allow the text in snippets, remove the attribute.

_03_At a glance

## data-nosnippet and AI features

Google's page on AI features says to use `nosnippet`, `data-nosnippet`, `max-snippet` or `noindex` controls to limit the information shown from your pages in Search, which includes AI features. The robots meta documentation adds that `nosnippet` also prevents the content from being used as a direct input for [AI Overviews](/glossary/ai-overviews) and [AI Mode](/glossary/ai-mode).

Control

### `data-nosnippet`

Level

Part of a page

Effect described by Google

That text is not used in a snippet

Control

### `nosnippet`

Level

Whole page

Effect described by Google

No text snippet or video preview in results; also blocks direct input to AI Overviews and AI Mode

Control

### `max-snippet`

Level

Whole page

Effect described by Google

Limits snippet length

Control

### `noindex`

Level

Whole page

Effect described by Google

Page is not shown in Search results

Be precise about scope. These are Google Search controls, and Google's documentation doesn't mention other AI assistants. For ChatGPT, Claude or Perplexity, use the robots.txt tokens in the guide to [blocking AI training while staying in AI search](/ai-search/block-ai-training-keep-ai-search).

Structured data is treated differently: Google says it remains usable for search results when declared within a `data-nosnippet` element.

_04_How it works

## Check it in two minutes

1. 1

### View rendered HTML

Open DevTools, inspect the element and confirm `data-nosnippet` is present on a `span`, `div` or `section` with its tags closed.
2. 2

### Confirm it is in the first HTML

Run `curl -s https://example.com/page | grep data-nosnippet`. If JavaScript adds it to an element that already exists, put it in the server HTML instead.
3. 3

### Inspect with Google

Run the URL through the URL Inspection tool in Search Console. Google says to verify implementation there and allow time for recrawling.

A change doesn't take effect until Google recrawls the page, and Google says that can take anywhere from several days to several months. Tracking the effect on [AI Overviews](/ai-search/google-ai-overviews) is a matter of re-checking after the recrawl.

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ Which elements support data-nosnippet?

Google documents `span`, `div` and `section` elements. It is a boolean attribute, so any value is ignored.

_02_ Does data-nosnippet remove a page from search?

No. It only marks part of the page as not usable in a snippet. To keep a page out of results, use `noindex`.

_03_ Does data-nosnippet stop AI Overviews using my text?

Google lists `data-nosnippet` among the controls for limiting the information shown from your pages in Search. Only the page-level `nosnippet` rule is documented to also stop content being used as a direct input for AI Overviews and AI Mode.

_04_ Can I add data-nosnippet with JavaScript?

Google says not to add or remove it on existing nodes with JavaScript. If you create a new element with JavaScript, include the attribute when you first add it to the DOM.

Sources · 2

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- google.com

1. 01 [Robots meta tag, data-nosnippet, and X-Robots-Tag specifications (Google Search Central)](https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag) developers.google.com · checked 2026-10-25
2. 02 [AI features and your website (Google Search Central)](https://developers.google.com/search/docs/appearance/ai-features) developers.google.com · checked 2026-10-25

## Keep learning

[All ai search](/ai-search)

[Learn Google AI Overviews SEO Engines](/ai-search/google-ai-overviews) [Related AI Overviews AI search](/glossary/ai-overviews) [Read next How to turn off Google AI Mode Guides](/ai-search/how-to-turn-off-google-ai-mode) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in AI search
[Copilot ads](/ai-search/copilot/ads) [Copilot shopping](/ai-search/copilot/shopping) [Does ChatGPT use Bing?](/ai-search/does-chatgpt-use-bing) [Does Perplexity use Google?](/ai-search/does-perplexity-use-google)

More in Guides
[AI search vs. Google Search](/ai-search/ai-search-vs-google-search) [AI SEO](/ai-search/ai-seo) [AI share of voice](/ai-search/ai-share-of-voice) [AI shopping agents](/ai-search/ai-shopping-agents) [AI visibility audit](/ai-search/ai-visibility-audit) [ai.txt](/ai-search/ai-txt) [Block AI training, stay in AI search](/ai-search/block-ai-training-keep-ai-search) [Block ChatGPT](/ai-search/block-chatgpt) [Brand mentions in AI answers](/ai-search/brand-mentions-ai) [ChatGPT Instant Checkout](/ai-search/chatgpt-instant-checkout) [Cloudflare pay per crawl](/ai-search/cloudflare-pay-per-crawl) [Conversational search](/ai-search/conversational-search) [data-nosnippet](/ai-search/data-nosnippet) [GEO vs SEO (and AEO)](/ai-search/geo-vs-seo) [How to turn off Google AI Mode](/ai-search/how-to-turn-off-google-ai-mode) [LLM SEO](/ai-search/llm-seo) [LLM visibility](/ai-search/llm-visibility) [Optimize for AI Overviews](/ai-search/optimize-for-ai-overviews) [Remove AI Overviews from Google Search](/ai-search/remove-ai-overview-from-google-search) [Structured data for AI search](/ai-search/structured-data-ai-search) [The llms.txt guide](/ai-search/llms-txt-guide) [The noai meta tag](/ai-search/noai-meta-tag) [Track AI referral traffic in GA4](/ai-search/ai-referral-traffic-ga4) [Agentic commerce](/ai-search/agentic-commerce)

Terms on this page
[Search snippet](/glossary/snippet) [Robots meta tag](/glossary/robots-meta-tag) [SERP](/glossary/serp) [Rendering](/glossary/rendering) [AI Overviews](/glossary/ai-overviews) [AI Mode](/glossary/ai-mode)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
