// SEO plans from €35/hour or €395/month// from €35/hr · €395/mo Free SEO checker[email protected]+31 6 4555 9353
Free SEO audit
technical seo

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
snippet controlexample
<meta name="robots"
  content="max-snippet:160">

<p>Public text.</p>
<span data-nosnippet>Hidden</span>
// quick answer
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

ControlScopeEffect
nosnippetWhole pageNo text snippet or video preview
max-snippet:[n]Whole pageText snippet capped at n characters
max-image-previewWhole pagenone, standard or large image preview
max-video-preview:[n]Whole pageVideo snippet capped at n seconds
data-nosnippetPart of a pageExcludes 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

0nosnippetsame effect
-1no limitGoogle chooses
ncharsmaximum length
invalidignorednumber
<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

RuleValues
max-image-previewnone (no preview), standard (default size), large (up to viewport width)
max-video-previewSeconds; 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>
RuleDetail
Valid elementsOnly span, div and section
Attribute typeBoolean; any value, even “true” or “false”, is ignored; presence alone matters
HTMLMust be valid with tags closed; an unclosed element can extend exclusion to following content
Structured dataInside a data-nosnippet element it remains usable
JavaScriptAvoid adding or removing it via script; include it when the element is first inserted
Custom elementsWrap them in a div, span or section

Apply a control step by step

1
decide

What do you want to limit?

The whole snippet, its length, or one part of the page.

pagepart
2
choose

Pick the control

Use the table above.

nosnippetmax-snippetdata-nosnippet
3
add

Add it correctly

Meta tag in the head, or the attribute on a span, div or section.

metaattribute
4
allow

Keep the page crawlable

A robots.txt block hides the rules from Google.

robots.txt
5
verify

Test the live page

Use the URL Inspection tool and view the rendered HTML.

live test
6
wait

Allow for recrawl

Google applies the change on the next crawl.

recrawl

Should you limit snippets?

SituationSuggested approach (my own judgement)
Paid or premium text you do not want previeweddata-nosnippet on that part
Licensing concerns over text usenosnippet, aware of the visibility trade-off
You want maximum visibilityLeave defaults; allow large image previews
Short preview preferredmax-snippet at a sensible length
Restricting snippets can reduce what searchers see about your page, which may affect clicks. Google does not give a number for the effect.

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

SymptomLikely cause (my own diagnosis)Fix
Hidden text still showsAttribute on an invalid elementUse span, div or section
Too much text excludedUnclosed tagFix the HTML
No effectPage blocked in robots.txtAllow crawling
Rule changes ignoredAdded by JavaScript lateInclude 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

mistake 1

data-nosnippet=”false”

Value is ignored; it still applies.

Remove the attribute instead.
mistake 2

Wrong element

Invalid on other tags.

Use span, div or section.
mistake 3

Unclosed tags

Exclusion spreads.

Validate the HTML.
mistake 4

Expecting max-snippet to limit rich results

It does not.

Use other controls.
mistake 5

Blocking in robots.txt

Rules invisible.

Allow crawling.
mistake 6

Over-restricting

Hurts visibility.

Limit only what you must.

Related guides

faq

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.

sources

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.

Scroll to Top