Guide SEO titles and snippets · 7 of 9

nosnippet, max-snippet and data-nosnippet: How to Control Your Snippet

Control your search snippet with nosnippet, max-snippet, and data-nosnippet: what each does in Google and Bing, a goal-to-control table, and code.

Updated 5 min read Fact-checked by Dex · 6 claims, 0 open

Key takeaways

  • nosnippet removes the text snippet but keeps the page indexed.
  • max-snippet sets a character limit for the snippet.
  • data-nosnippet hides only marked parts of a page.

Google and Bing let you control how much of your page text shows as a snippet in search results. There are three main tools. nosnippet removes the text snippet for a whole page. max-snippet sets a character limit. data-nosnippet hides only certain parts of a page. Each one is useful in a few cases, and each one has a cost if you use it by mistake.

This guide explains what each control does, based on Google’s and Bing’s documentation, and ends with a goal-to-control table and three code snippets. For writing the meta description itself, see the guide to SEO titles and meta descriptions.

Snippet controls are not indexing controls

This is the first thing to get right. noindex removes a page from search results. nosnippet keeps the page in results but removes the text summary. They solve different problems.

If you want a page gone from search, you need noindex, not a snippet rule. The guide to checking a noindex tag shows how to confirm what a page declares.

Snippet controls also do not change your title link, your site name, or your favicon. Those come from other sources. See the guides to site names in Google Search and favicons in Google Search.

nosnippet: no text snippet for the page

Google’s robots meta tag specification says nosnippet tells Google not to show a text snippet or video preview for the page. A static image thumbnail may still appear when Google thinks it helps.

Google says this rule applies to all forms of its search results, and it lists web search, Google Images, Discover, AI Overviews, and AI Mode. It also says the rule prevents the content from being used as a direct input for AI Overviews and AI Mode.

The cost is clear. Your result shows a title and no summary. People have less to go on when they choose. Use it only when showing any text would cause a real problem.

max-snippet: a character limit

max-snippet:[number] tells Google to use at most that many characters as a text snippet. Google says it applies to all forms of its search results, including AI Overviews and AI Mode, and limits how much content may be used as a direct input for those features.

Two special values exist. max-snippet:0 means no snippet, the same as nosnippet. max-snippet:-1 lets Google choose the length. If you set no rule, Google chooses.

Google notes one exception. The limit does not apply where a publisher has separately granted permission, such as in-page structured data or a license agreement with Google.

data-nosnippet: hide parts of a page

data-nosnippet is an HTML attribute, not a page-level rule. You add it to specific elements. Google supports it on span, div, and section elements. The rest of the page can still be used for snippets.

Google gives a few rules for using it:

  • It is a boolean attribute. Any value you add is ignored.
  • The HTML must be valid, with all tags closed. An unclosed div hides everything after it.
  • Do not add or remove it with JavaScript on existing elements. If JavaScript creates the element, include the attribute from the start.

Bing added support in October 2025. Its announcement on the Bing Webmaster Blog says marked content is kept out of Bing Search snippets and AI-generated answers, including Copilot experiences powered by Bing. Bing also says the content is still indexed and available for ranking.

Where to place the rules

Page-level rules like nosnippet and max-snippet go in a robots meta tag in the page head. For files that are not HTML, such as PDFs, use the X-Robots-Tag HTTP header instead. Google says any rule that works in the meta tag also works in the header.

Google adds that crawlers can only follow these settings if they are allowed to fetch the page. If robots.txt blocks the page, the rule is never read.

When rules conflict, Google applies the more restrictive one. A page with max-snippet:50 and nosnippet gets no snippet.

Snippet controls and AI answers

Many site owners now ask how these rules affect AI answers. Stick to what each search engine documents. Google documents that nosnippet and max-snippet apply to AI Overviews and AI Mode as described above. Bing documents that data-nosnippet keeps marked content out of its AI-generated answers.

Blocking text from snippets also removes it as a source people might see. If your goal is to appear in AI answers, these rules work against you. The guide to showing up in ChatGPT and AI answers covers that goal.

When a snippet control is the wrong fix

Sometimes a team adds nosnippet because Google shows an odd snippet. Usually the better fix is a clearer description or clearer page text. Google’s guide to controlling snippets explains how it builds snippets and how to write good descriptions.

The same is true for repeated text. If many pages show the same snippet, the cause is often a template. See the guide to duplicate title tags and meta descriptions. On archive pages, a weak snippet often means the archive needs a short intro; the guide to category page title tags covers that.

Worked example: three goals, three controls

Fictional example. An imaginary training company has three needs:

  • A page with a short exam answer key should not show any text in results. They use nosnippet on that page.
  • Course pages show long snippets that give away the full outline. They set max-snippet:160.
  • A cookie notice keeps appearing in snippets. They wrap it in a div with data-nosnippet.

Every other page keeps the default. Google chooses the snippet length there.

Where DEX fits

DEX connects search research, content planning, article writing, and publishing on the connected site. Snippet rules are page settings. Review them with your developer, and check the live page after any change.

Goal-to-control table

Goal Control Where it goes Cost
Remove the page from search noindex (not a snippet rule) Robots meta tag or X-Robots-Tag The page will not appear at all
Show no text snippet for the page nosnippet or max-snippet:0 Robots meta tag or X-Robots-Tag Result shows no summary
Limit snippet length max-snippet:[number] Robots meta tag or X-Robots-Tag Shorter summaries; limits direct use in Google’s AI features
Hide one part of a page data-nosnippet On a span, div, or section That part will not be quoted in snippets
Control a PDF or other file X-Robots-Tag header HTTP response header Needs server or CDN access
Fix an odd snippet Usually none; improve the description or page text Page content Takes editing time

Code snippets

1. Robots meta tag (in the page head):

<meta name="robots" content="max-snippet:160">

2. X-Robots-Tag header (for a PDF or other file):

HTTP/1.1 200 OK
Content-Type: application/pdf
X-Robots-Tag: nosnippet

3. data-nosnippet attribute (on part of a page):

<p>This text can appear in a snippet.</p>
<div data-nosnippet>
  <p>This notice will not appear in snippets.</p>
</div>

FAQ

Is nosnippet the same as noindex?

No. noindex removes the page from results; nosnippet removes only the text snippet.

Does nosnippet affect AI Overviews?

Google says nosnippet applies to AI Overviews and AI Mode and prevents direct use as input.

Does Bing support data-nosnippet?

Yes. Bing announced support in October 2025 for search snippets and AI answers.

Sources

  1. Robots meta tag, data-nosnippet, and X-Robots-Tag specifications · Google
  2. Control your snippets in search results · Google
  3. Bing Introduces Support for the data-nosnippet HTML Attribute · Microsoft Bing

Dex SEO is an AI SEO agent for small businesses. Every article here is planned from search data, drafted by Dex, fact-checked against the sources it cites, and reviewed by the team before it is published.

How this article was made: planned and drafted by Dex from search data, fact-checked by Dex (6 claims checked), then approved by the Dex SEO team.

Next in this cluster

Keep going

All topics