nosnippet, max-snippet and data-nosnippet
Google lets you control how much of your page appears in search results. This guide explains nosnippet, max-snippet, max-image-preview, max-video-preview and the data-nosnippet attribute, with exact syntax, valid elements, conflict rules and the trade-offs of limiting snippets.
- 4 page-level controls
- data-nosnippet rules
- Examples
- Trade-offs
<meta name="robots" content="max-snippet:160"> <p>Public text.</p> <span data-nosnippet>Hidden</span>
nosnippet blocks text snippets and video previews. max-snippet:[number] caps snippet length in characters. data-nosnippet hides a specific part of a page from snippets; it works only on span, div and section elements and is a boolean attribute. The most restrictive rule wins, and none of it works if robots.txt blocks the page.
The controls at a glance
| Control | Scope | Effect |
|---|---|---|
| nosnippet | Whole page | No text snippet or video preview |
| max-snippet:[n] | Whole page | Text snippet capped at n characters |
| max-image-preview | Whole page | none, standard or large image preview |
| max-video-preview:[n] | Whole page | Video snippet capped at n seconds |
| data-nosnippet | Part of a page | Excludes that part from snippets |
The first four are robots rules set with a meta tag or X-Robots-Tag; see robots meta tag and X-Robots-Tag.
nosnippet
nosnippet blocks text snippets and video previews across Google surfaces, including AI Overviews and AI Mode, and prevents the content from being used as direct input for those features. A static image thumbnail may still appear. Without the rule, Google may generate a snippet.
<meta name="robots" content="nosnippet">
max-snippet
<meta name="robots" content="max-snippet:50">
It caps the text snippet only. It does not affect image or video previews, and it does not limit structured data used for rich results.
Image and video previews
| Rule | Values |
|---|---|
| max-image-preview | none (no preview), standard (default size), large (up to viewport width) |
| max-video-preview | Seconds; 0 allows at most a static image; -1 removes the limit |
Google notes publishers can use standard or none to stop larger thumbnails appearing with AMP or canonical article versions.
data-nosnippet
Use it to exclude parts of a page from snippets.
<p>This text can appear in snippets. <span data-nosnippet>This part cannot.</span> </p> <div data-nosnippet>A whole block excluded.</div>
| Rule | Detail |
|---|---|
| Valid elements | Only span, div and section |
| Attribute type | Boolean; any value, even “true” or “false”, is ignored; presence alone matters |
| HTML | Must be valid with tags closed; an unclosed element can extend exclusion to following content |
| Structured data | Inside a data-nosnippet element it remains usable |
| JavaScript | Avoid adding or removing it via script; include it when the element is first inserted |
| Custom elements | Wrap them in a div, span or section |
Apply a control step by step
What do you want to limit?
The whole snippet, its length, or one part of the page.
Pick the control
Use the table above.
Add it correctly
Meta tag in the head, or the attribute on a span, div or section.
Keep the page crawlable
A robots.txt block hides the rules from Google.
Allow for recrawl
Google applies the change on the next crawl.
Should you limit snippets?
| Situation | Suggested approach (my own judgement) |
|---|---|
| Paid or premium text you do not want previewed | data-nosnippet on that part |
| Licensing concerns over text use | nosnippet, aware of the visibility trade-off |
| You want maximum visibility | Leave defaults; allow large image previews |
| Short preview preferred | max-snippet at a sensible length |
Notes for WordPress sites
- Plugin settings. Some SEO plugins expose max-snippet and image preview defaults (my own note). See Yoast SEO settings.
- Page builders. Add data-nosnippet with a custom attribute setting on a div or section, not on a custom widget wrapper.
- Dynamic content. If a script injects the block, add the attribute at insertion.
Troubleshooting
| Symptom | Likely cause (my own diagnosis) | Fix |
|---|---|---|
| Hidden text still shows | Attribute on an invalid element | Use span, div or section |
| Too much text excluded | Unclosed tag | Fix the HTML |
| No effect | Page blocked in robots.txt | Allow crawling |
| Rule changes ignored | Added by JavaScript late | Include it in initial HTML |
Checklist
Rules
- Right control chosen
- Valid number or setting
- No conflicting directives
- Strictest rule understood
data-nosnippet
- On span, div or section
- HTML valid
- No script toggling
- Present on first render
Access
- Not blocked in robots.txt
- Page returns 200
- Cache purged
- Live test checked
Impact
- Review visibility trade-off
- Monitor CTR
- Document why
- Review yearly
What Google’s page does not say
Google does not quantify how snippet limits affect traffic or rankings, and it does not say how long changes take to apply beyond the next crawl.
Key terms
- Snippet
- The text excerpt shown under a result.
- Boolean attribute
- An attribute whose presence alone matters.
- AI Overviews
- Google’s AI-generated summaries in search.
- Preview
- An image or video excerpt in results.
Common mistakes
data-nosnippet=”false”
Value is ignored; it still applies.
Wrong element
Invalid on other tags.
Unclosed tags
Exclusion spreads.
Expecting max-snippet to limit rich results
It does not.
Blocking in robots.txt
Rules invisible.
Over-restricting
Hurts visibility.
Related guides
Snippet control questions
What does nosnippet do?
It blocks text snippets and video previews, including in AI Overviews and AI Mode.
What does max-snippet:0 mean?
The same as nosnippet.
Which elements accept data-nosnippet?
Only span, div and section.
Can I write data-nosnippet=”false”?
No effect; the value is ignored and the attribute still applies.
Does it affect structured data?
Structured data inside a data-nosnippet element remains usable.
What if rules conflict?
The more restrictive rule wins, for example nosnippet over max-snippet:50.
Can JavaScript add the attribute?
Google advises against adding or removing it that way; include it at first insertion.
Does it still show an image?
A static image thumbnail may still appear with nosnippet.
The rules, values and data-nosnippet requirements come from Google’s page. The should-you table, step-by-step routine, WordPress notes, troubleshooting table and checklists are my own.