How do nosnippet, max-snippet, and data-nosnippet work?
guide // , 6 min read, by Darthwares
The `nosnippet` meta tag, `max-snippet` meta tag, and `data-nosnippet` attribute are controls that allow you to manage how your website's content appears as a snippet in Google Search results. These controls prevent or limit the text and video previews that Google shows for your pages, including in AI Overviews and AI Mode. Understanding how to implement and verify these settings helps you control your content's visibility in various search features.
On this page // 7 sections
- 01What are snippets in search results?
- 02How do nosnippet, max-snippet, and data-nosnippet control content?
- 03How do you implement snippet controls?
- 04How do snippet controls affect AI Overviews and AI Mode?
- 05What happens with conflicting rules or crawling issues?
- 06How can you check your snippet control implementation?
- 07Common questions
The short version
- Snippets are summaries of your page content shown in search results, automatically generated by Google from your page content or meta description.
- The `nosnippet` meta tag prevents any text snippet or video preview for a page in all Google Search results, including AI features.
- The `max-snippet` meta tag sets a maximum character length for a page's textual snippet.
- The `data-nosnippet` attribute allows you to exclude specific HTML elements from appearing in a snippet.
- These controls are implemented via meta tags in the HTML head for page-level settings or as attributes on HTML elements for text-level control.
What are snippets in search results?
A snippet is the description or summary that appears below a page's title in Google Search results and other Google properties, such as Google News. Google primarily uses the content on your page to automatically determine the appropriate snippet for a search result.
Sometimes, Google may use the content from a page's `<meta name="description">` tag to generate a snippet if it provides a more accurate description for users than the on-page content alone. While there is no limit to the length of a meta description, the snippet displayed in search results is typically truncated to fit the device width.
How do nosnippet, max-snippet, and data-nosnippet control content?
Google provides specific controls to prevent or limit the information shown from your pages in search results. These controls allow you to manage whether a snippet is created and displayed for your site, or to specify the maximum length for your snippets. They apply to all forms of Google Search results, including web search, Google Images, Discover, AI Overviews, and AI Mode.
You can prevent snippets from displaying in search results entirely, or you can specify a maximum length. Additionally, you can exclude specific parts of an HTML page from being included in a snippet.
- nosnippet: This directive prevents Google from showing any text snippet or video preview for the page in search results. It also stops the content from being used as a direct input for AI Overviews and AI Mode.
- max-snippet: [number]: This directive specifies the maximum number of characters Google can use as a textual snippet for a search result. For example, setting `max-snippet:0` will prevent any snippet from displaying.
- data-nosnippet: This attribute can be applied to specific HTML elements, such as `div`, `span`, and `section` tags, to exclude their content from snippets. This allows you to prevent certain parts of a page from being shown in a snippet while allowing other parts to be used.
How do you implement snippet controls?
You can specify page-level settings for snippet controls by including a meta tag within the `<head>` section of your HTML pages or in an HTTP header. Meta tags are HTML tags that provide additional information about a page to search engines.
For text-level settings, you can use the `data-nosnippet` attribute on specific HTML elements within the page. This attribute can be applied to `div`, `span`, and `section` tags to exclude their content from snippets. The `<meta name="robots" ...>` tag applies to all search engines, while the `<meta name="googlebot ...>` tag is specific to Google.
| Control | Implementation |
|---|---|
| nosnippet (page-level) | <meta name="robots" content="nosnippet"> |
| max-snippet (page-level) | <meta name="robots" content="max-snippet:0"> |
| data-nosnippet (element-level) | <div data-nosnippet>This text will not appear in a snippet.</div> |
How do snippet controls affect AI Overviews and AI Mode?
Snippet controls directly influence how your content interacts with Google's AI features, such as AI Overviews and AI Mode. The `nosnippet`, `max-snippet`, and `data-nosnippet` directives prevent your content from being used as a direct input for these AI features.
For a page to be eligible to be shown as a supporting link in AI Overviews or AI Mode, it must be indexed by Google and eligible to be shown in Google Search with a snippet. If you use `nosnippet` or `max-snippet:0`, your page will not be eligible for these supporting links. Google documents that SEO best practices remain relevant for AI features in Google Search. The `robots.txt` file remains the primary control for site owners to manage how Googlebot crawls their sites for Search, which includes AI features.
What happens with conflicting rules or crawling issues?
When there are conflicting robots rules, Google applies the more restrictive rule. This principle also applies to conflicting `robots` or `googlebot` meta tags; the more restrictive tag takes precedence. For example, if one meta tag allows a snippet and another disallows it, the `nosnippet` rule will be followed.
It is important to note that if a page is disallowed from crawling through the `robots.txt` file, any information about indexing or serving rules, including snippet controls, will not be found by Googlebot. In such cases, these rules will be ignored because the page content cannot be accessed.
How can you check your snippet control implementation?
To verify that your snippet controls are correctly implemented, you can use Google's URL Inspection tool. This tool allows you to see the HTML that Googlebot received when it crawled your page, helping you confirm that the meta tags and attributes are present and correctly configured.
After making changes to your snippet controls, allow time for Google to recrawl and process the updates. If you need the changes to be reflected more quickly, you can request that Google recrawl your pages through Google Search Console.
Common questions
What is the default behavior for snippets?
By default, Google automatically determines and generates a snippet for your page from its content or meta description. The default values for robots meta tags are `index` and `follow`, and they do not need to be explicitly specified.
Can I prevent only parts of my page from appearing in a snippet?
Yes, you can prevent specific parts of your page from being shown in a snippet by using the `data-nosnippet` attribute. This attribute can be applied to `div`, `span`, and `section` tags to exclude their content from snippets.
Do these controls apply to all search engines?
The `<meta name="robots" ...>` tag applies to all search engines. However, Google also supports a `<meta name="googlebot ...>` tag, which is specific to Google. In cases of conflicting rules, the more restrictive tag applies.
How long does it take for changes to snippet controls to take effect?
After implementing changes to your snippet controls, you need to allow time for Google to recrawl and process the updates. You can use the URL Inspection tool to check if Googlebot has received the changes, and you can request a recrawl of your pages to expedite the process.
What if my robots.txt file disallows a page?
If a page is disallowed from crawling through your `robots.txt` file, Googlebot will not be able to access the page. In this scenario, any snippet control information on that page will not be found and will therefore be ignored.
Primary sources and further reading
This article was researched and written by an AI model and published automatically. It was written from sentences that were checked to appear on the pages below, but a person has not reviewed the text. If something is wrong, tell us at chibivikramathithan@darthwares.com and we will correct it.