SEO

nosnippet, max-snippet and data-nosnippet: How to Control Snippets

Talha Aslan 18 min read

Short answer

What are nosnippet, max-snippet and data-nosnippet?

nosnippet, max-snippet and data-nosnippet are three official Google controls for the text snippet under your search result. nosnippet removes the snippet entirely. max-snippet caps its length in characters. data-nosnippet keeps one specific part of a page out of the snippet while the rest stays eligible.

Keep reading for the full details and examples

The three rules belong to the same family, but they work at different levels. The first two apply to a whole page through the robots meta tag or an HTTP header. data-nosnippet, by contrast, is an attribute you add to a single element in your HTML. So the right choice depends on what you want to hide: the whole snippet, its length, or just one block of text.

At Talha Aslan and team, we usually meet these rules while undoing a mistake rather than solving a problem. For example, a single nosnippet line in a theme template can leave every result of a site with an empty description. In this guide, we explain each rule using the Google Search Central documentation. We also show, step by step, when each one helps and when it quietly hurts your visibility.

What is a snippet, and where does Google take it from?

A snippet is the description or summary part of a search result. According to Google's snippet documentation, snippets come primarily from the page content itself. Google sometimes uses the meta description instead, because that text might describe the page more accurately for the user.

There is an important detail here. Snippets depend on the query. In other words, the same page can show two different snippets for two different searches. That is why you cannot edit an individual snippet by hand. Still, a strong meta description gives Google a good candidate. We cover that side in our guide to writing meta titles and descriptions.

Snippet directives work in the opposite direction. You do not tell Google what to show. Instead, you tell Google what not to show, or how much to show. Put simply, a meta description is a suggestion, while nosnippet and max-snippet are limits. Google follows the limits. It does not have to use the suggestion.

If you want a rough idea of how your snippet might look, try our Google SERP preview tool. However, any preview is an estimate. Only Google decides the real snippet.

What exactly does the nosnippet rule turn off?

Google's robots meta tag documentation says nosnippet asks Google not to show a text snippet or video preview in the search results for the page. The same page notes that a static image thumbnail may still appear when it results in a better user experience.

Therefore, nosnippet does not remove the page from the index. Your page can keep appearing in search. Only the description area under the title stays empty or very limited. If you want the page out of the index, the rule you need is noindex. We compare the two in our noindex vs nofollow guide.

The rule also affects featured snippets. Google's featured snippet documentation states that nosnippet blocks all snippets, including featured snippets and regular snippets. In addition, the rule affects Google's AI features, which we cover in a separate section below.

  • The page stays in the index.
  • Google shows no text snippet and no video preview.
  • The page can no longer appear as a featured snippet.
  • Searchers see very little about your page before they click.

How do max-snippet values work?

max-snippet sets the maximum number of characters Google may use as a text snippet. You write the value as a number, and Google limits the snippet to that length. For example, max-snippet:120 asks Google to keep the snippet within 120 characters.

The documentation defines two special values. The first is 0, which means no snippet at all. It works the same way as nosnippet. The second is -1. With that value, Google chooses the snippet length it believes is most effective to help users discover your content. If you leave the rule out, Google also chooses the length.

So when does max-snippet make sense? The most common case is reducing featured snippet appearances while keeping the regular snippet. Google's featured snippet documentation says site owners who want to keep regular snippets can try lower max-snippet values. That said, the same page gives no exact minimum length. It also says a low value does not guarantee that featured snippets stop. For a guaranteed result, Google points to nosnippet.

Also, according to the robots meta tag documentation, max-snippet does not limit structured data used for rich results. The exception is description fields such as article.description, which the rule can govern. We return to this point in the structured data section.

Which HTML elements support data-nosnippet?

data-nosnippet hides a specific piece of text instead of the whole page. According to Google, the attribute works on span, div and section elements. The documentation even shows an example on a made up element and labels it as not valid.

It is a boolean attribute. In other words, any value you give it does not matter; the attribute only needs to exist. However, there are two technical conditions. First, the marked HTML section must be valid, and every tag must close properly. Second, you should not add or remove the attribute on existing nodes through JavaScript.

According to the featured snippet documentation, text marked with data-nosnippet will not appear in featured snippets or regular snippets. In addition, if both rules exist on one page, nosnippet takes priority. Google then shows no snippet for the page.

  • Valid elements: span, div and section.
  • The value does not matter. Presence is enough.
  • The HTML must be valid, with no unclosed tags.
  • Do not toggle the attribute later with JavaScript.

In practice, the attribute suits cookie notices, promo banners, legal disclaimer boxes and shipping text that repeats on every page. As a result, Google tends to pick the snippet from the main content.

Snippet directives compared in one table

The table below follows the definitions in Google's robots meta tag documentation. We put it together so you can see values and effects at a glance.

RuleWhere it goesScopeWhat it doesTypical use
nosnippetRobots meta tag or X-Robots-TagWhole pageTurns off the text snippet and video previewPages that should never show a snippet
max-snippet:[number]Robots meta tag or X-Robots-TagWhole pageCaps snippet length in characters; 0 means none, -1 lets Google decideKeeping a snippet but making it shorter
data-nosnippetHTML attribute on span, div, sectionOne block of textKeeps the marked text out of snippetsCookie notice, repeated banner, legal box
max-image-previewRobots meta tag or X-Robots-TagWhole pageSets image preview size to none, standard or largeShrinking or turning off image previews
max-video-preview:[seconds]Robots meta tag or X-Robots-TagWhole pageCaps video preview length in seconds; -1 means no limitShortening video previews

The phrase "whole page" matters. A page level rule changes how that page appears for every query. For that reason, we recommend testing page level rules on a small group of pages first. Also, keep a dated note of every change, because it makes later traffic analysis much easier.

How do max-image-preview and max-video-preview relate to snippets?

These two rules do not control the text snippet. Instead, they manage the image and video part of the preview. Because they shape the overall look of your result, they still belong to snippet control.

max-image-preview accepts three values. none shows no image preview. standard allows a default size preview. large allows a larger preview, up to the width of the viewport. Sites with strong visual content often prefer large, because a bigger preview can make the result stand out.

max-video-preview takes a number of seconds. A value of 0 allows at most a static image, and that image follows your max-image-preview setting. A value of -1 means there is no limit. In short, if you want a shorter video preview rather than none at all, this rule is the right tool.

One point deserves attention. nosnippet already turns off video previews. So adding max-video-preview to a page that also has nosnippet adds nothing in practice. When rules conflict, the more restrictive one applies, and the result still follows nosnippet.

Should you use the robots meta tag or X-Robots-Tag?

According to Google, any rule you can use in a robots meta tag also works as an X-Robots-Tag HTTP header. The difference lies in where the rule lives. A meta tag sits in the head section of an HTML page. The X-Robots-Tag, on the other hand, travels in the response header your server sends.

For HTML pages, the meta tag is usually more practical. Your content management system or SEO plugin can manage it page by page. Conceptually, the tag looks like this: meta name="robots" content="max-snippet:150". You can build the tag correctly with our meta tag generator.

For non HTML files such as PDFs, you cannot write a meta tag. In that case, Google recommends the X-Robots-Tag. For instance, if you do not want a price list PDF to show a snippet, you define the right header for that file type in your server configuration.

The documentation also says Google supports two user agent tokens in the robots meta tag: googlebot and googlebot-news. If you use the robots name, the rule covers all crawlers. The googlebot name targets web text results, and googlebot-news targets news results. Google ignores other values.

How does nosnippet affect AI Overviews and AI Mode?

Google's robots meta tag documentation is clear here. nosnippet also prevents the content from being used as a direct input for AI Overviews and AI Mode. That sentence shows snippet control now reaches beyond the classic result description.

Google's AI features documentation draws the same picture. To limit the information shown from your pages in Search, you use nosnippet, data-nosnippet, max-snippet or noindex. Google-Extended is a separate control. It limits AI training and grounding in some of Google's other systems, so it is not the tool for how you appear in Search.

There is a real tradeoff here. If you want to appear as a source in AI Overviews, nosnippet works against you. Meanwhile, the same documentation says there are no additional technical requirements to appear in these features. You also do not need new machine readable files, AI text files or special markup. In other words, appearing needs nothing extra, while these rules exist for opting out.

We cover the content side of AI search in our guide to writing content for AI Overviews. We also look at click behavior in our article on whether AI Overviews reduce clicks. This article stays focused on restriction.

When does it make sense to use nosnippet?

For most sites, nosnippet is unnecessary by default. The snippet is one of the main texts that drive a click. Still, a few cases can justify it as a conscious decision.

  • Publishers who do not want a snippet to give away the core of paid content.
  • Organizations that need to limit quotation for legal or contract reasons.
  • Technical or legal text that can mislead when Google cuts it out of context.
  • Private material you do not want as a direct input for AI Overviews.

Each case on this list has a cost. Without a snippet, your result says less, and your click through rate can drop. That is why we suggest trying a narrower tool first. For example, if the problem is a cookie notice, data-nosnippet is enough. If the problem is length, max-snippet fits better.

In short, nosnippet should be a last resort. When we find the rule on a site, our first question is simple: who made this decision, and why? Often the answer is "nobody knows," and the rule comes from a theme or plugin setting. If you want someone to find that kind of leftover, clean it up and monitor what follows, our SEO consulting service covers exactly that. We diagnose the issue, fix it and keep tracking the results.

How do you set up snippet control step by step?

The order below stops a wrong setting from spreading across your whole site. We recommend finishing each step before you move to the next one.

  1. Define the goal. Do you want to hide the whole snippet, limit its length, or hide one block?
  2. Pick the rule. Use nosnippet for the whole snippet, max-snippet for length and data-nosnippet for one block.
  3. Set the scope. Decide which template or file type will carry the rule.
  4. Test on a few pages first. Do not add the rule to a sitewide template right away.
  5. Check that robots.txt does not block the page. Otherwise, Google cannot see the rule.
  6. Confirm in the live source code that the rule appears once and correctly.
  7. Test the live URL in Search Console and request a recrawl.
  8. Watch impressions and clicks for a few weeks.

Teams skip step four most often. They add the rule straight to the main template, and the mistake reaches every page at once. A narrow test, by contrast, shows the problem early and keeps rollback easy.

Pay attention to step six as well. On some sites, both the theme and the SEO plugin output their own robots meta tag. The page then carries two tags, and both count. The next section explains what happens in that case.

Which rule wins when robots rules conflict?

Google puts it in one sentence: in the case of conflicting robots rules, the more restrictive rule applies. For example, if one tag says max-snippet:-1 and another says nosnippet, the result is nosnippet.

The documentation also says you can combine rules in one tag with commas or place them in separate meta tags. When several crawler specific tags exist, the search engine uses the sum of the negative rules. So if you write one rule for robots and another for googlebot, Google considers both together.

This behavior creates a common trap. You set max-snippet to -1 in your SEO plugin and assume everything is open. However, a forgotten nosnippet line still sits in a theme file. Google then picks the more restrictive rule, and your snippet disappears.

The same logic applies between data-nosnippet and nosnippet. According to the featured snippet documentation, nosnippet takes priority when both exist. Therefore, an audit should check the live page source, not only the plugin settings.

Why does a robots.txt block make snippet directives invisible?

According to Google, these settings can only work if crawlers can access the page. If robots.txt blocks the page, Google finds no information about indexing or serving rules, and it ignores them.

This explains a common mistake. Some site owners combine a robots.txt block with nosnippet and believe they have double protection. In reality, the block stops the crawler from ever seeing the tag. If Google then learns about the URL through links from other sites, it can show a result without knowing your rule.

So the page must stay crawlable for a snippet rule to work. If you want to see how Google reads your robots.txt file, our article on the Search Console robots.txt report walks through it.

Put simply, robots.txt manages crawl access. Robots meta rules manage how Google presents a page it has crawled. You should not use one in place of the other.

What are the risks of using these rules the wrong way?

Snippet rules are powerful, and their mistakes are silent. Because the page stays indexed, many teams miss the problem for weeks. These are the risks we see most often in the field:

  • Sitewide nosnippet: one line in a theme or plugin template leaves every result without a description.
  • A very low max-snippet: the snippet ends on a meaningless fragment and fails to persuade anyone.
  • data-nosnippet around the main content: a wide div leaves Google with nothing useful to quote.
  • Invalid HTML: an unclosed tag can make the marked area cover more text than you intended.
  • JavaScript toggling: Google's documentation advises against adding or removing the attribute this way.
  • Turning off AI visibility by accident: nosnippet also blocks direct input to AI Overviews.

What these risks share is the lack of an error message. Traffic declines slowly, and teams often look for the cause elsewhere. That is why robots meta rules belong on every traffic drop checklist.

How do you verify the change in Search Console?

After you add or remove a rule, Google needs to recrawl the page. The AI features documentation says that if preview controls do not seem to work, you should allow time for Google to recrawl and process the change. According to that page, recrawling can take from days to months, and you can request a recrawl.

During this period, the URL Inspection tool in Search Console is your most practical helper. You run a live test to see how Google sees the page right now, and then you can request indexing. We explain the basics in our article on what Google Search Console is and how to use it.

We suggest verifying on two levels. The first level is technical: you confirm the rule appears in the live source as expected. The second level is about outcomes: you follow impressions and clicks for the affected pages in the Performance report from the change date onward.

To see whether the snippet changed in the results, you can also run a few typical searches yourself. However, remember that results can vary by person and location.

Do snippet rules affect structured data and rich results?

According to Google, robots meta tag limitations do not affect the use of structured data for rich results. The exception is description values such as article.description, which max-snippet can govern.

A similar rule applies to data-nosnippet. Google says structured data remains usable for search results even when you declare it within a data-nosnippet element. In other words, hiding a product box from the snippet does not on its own stop the price or rating markup in that box from feeding rich results.

This distinction matters most for online stores. For instance, you may want to keep repeated shipping text out of the snippet while keeping your product markup intact. data-nosnippet fits that case well, because it narrows the text snippet without switching off structured data.

Keep in mind that rich results themselves are never guaranteed. Structured data only makes a page eligible. Google decides what to show.

Example scenario: how would example.com set up snippet control?

This is an example scenario, not a real client case. Imagine an online store called example.com with three issues. The same shipping banner shows up in the snippet of every product page. PDF catalogs appear in search with raw text. And one guide page shows up as a featured snippet with a very long quote.

For the first issue, the narrowest fix is data-nosnippet on the div that wraps the shipping banner. Google then picks the snippet from the product description, and the product markup stays in place.

For the second issue, the team cannot write a meta tag inside a PDF. So they set an X-Robots-Tag header with nosnippet for PDF responses on the server side. Then they test a few PDF URLs with the URL Inspection tool.

The third issue needs more care. The store wants the guide page to rank, but it does not want the long quote. A first attempt could use a shorter max-snippet value. However, Google's documentation says this does not guarantee the featured snippet goes away. Therefore, the team monitors the result for a few weeks and revisits the decision if needed.

If you are curious about the opposite goal, read our guide on how to win featured snippets.

How does our team support snippet control?

Snippet directives are not an SEO strategy on their own. Yet when someone sets them up wrong, they can hide the results of an otherwise good strategy. At Talha Aslan and team, our technical audits check robots meta rules, X-Robots-Tag headers and data-nosnippet usage on the same list.

The process usually has three steps. First, we review live page sources and response headers to see which rule comes from where. Next, we go through each rule with you and check whether it has a real reason. Finally, we apply changes to a small group of pages, follow the Search Console data and report the outcome.

We want to be clear about one thing: no setting guarantees rankings. Our commitment is to remove wrong rules, set the right ones with a documented reason and track the results transparently. If your site has a visibility problem tied to snippets or indexing, you can request a proposal on our SEO consulting page. We then define the scope together, based on how your site works.

A short checklist for snippet control

Let us close with a practical list. You can run it during every technical audit or after any theme change.

  • How many robots meta tags does the live page source contain, and what do they say?
  • Do non HTML files carry an X-Robots-Tag header on purpose?
  • If nosnippet exists, is there a written reason for it?
  • Is the max-snippet value long enough to leave a meaningful snippet?
  • Does data-nosnippet sit only on span, div or section, and is the HTML valid?
  • Does robots.txt block any page that carries a rule? If so, Google cannot read it.
  • Did you run a live URL test after the change?

Finally, remember that nosnippet, max-snippet and data-nosnippet are legitimate, documented controls. Used in the right place, they help you manage how Google quotes your content. Used in the wrong place, they quietly reduce your visibility. So start every rule with a small test, follow the data and write down the reason behind it.

Core guide: What Is Digital Marketing? Its types, examples and how it is done, on one page with an interactive film that travels through the brain.

Frequently Asked Questions

Does nosnippet remove my page from Google's index?
No, nosnippet does not remove the page from the index. Your page can keep appearing in search results, but Google shows no text snippet or video preview under the title. If you want the page out of the index entirely, use noindex instead. We recommend keeping the two rules apart and using each one for its own job.
What value should I choose for max-snippet?
There is no single right value; it depends on your goal. A value of 0 turns the snippet off and works like nosnippet. A value of -1 lets Google choose the length. A specific number sets an upper limit. Avoid very low numbers so the snippet stays meaningful, and test the change on a few pages first.
Which HTML elements support data-nosnippet?
Google supports data-nosnippet only on span, div and section elements. It is a boolean attribute, so any value you give it does not matter. The marked section must be valid HTML with properly closed tags. Also, do not add or remove the attribute on existing elements later through JavaScript, because Google advises against it.
Does nosnippet keep my content out of AI Overviews?
Yes, Google's documentation says nosnippet also prevents content from being used as a direct input for AI Overviews and AI Mode. So if you want to appear as a source in those features, the rule works against you. Appearing needs no extra technical steps, while snippet rules exist for site owners who want to limit what Search shows.
Will nosnippet work on a page blocked by robots.txt?
No, it will not. According to Google, robots meta rules only work when crawlers can access the page. If robots.txt blocks the page, Google never sees the tag and ignores the rule. If you want snippet control, allow crawling and set the restriction with a robots meta tag or an X-Robots-Tag header instead.
How long does it take for the change to show in search?
There is no fixed timeline, because Google first needs to recrawl the page. Google's AI features documentation says recrawling can take from days to months. You can run a live test in the URL Inspection tool and request indexing. After that, follow the affected pages in the Performance report for a few weeks.
  • nosnippet
  • max-snippet
  • data-nosnippet
  • robots meta tag
  • X-Robots-Tag
  • search snippets
  • technical SEO
Share:
Talha Aslan

Google Partner digital marketing expert. Hands-on with SEO, Google Ads, web design and e-commerce projects since 2012; every post here comes from that experience.

Next project

Get a quote for your project.

Your brief goes straight to Talha Aslan and team: strategy led by Talha, delivery by an experienced team. We reply the same day and send the scope, timeline and price as a written quote within 1 business day.