Book Now
Advanced Technical SEO

The data-nosnippet Attribute

How to Prevent Unwanted Text from Appearing in Google SERPs

The data-nosnippet Attribute
Author:
Carlos Sánchez
Topics:
Metatags
Publication Date:
2025-10-23

Last Review:
2025-10-23

The meta description is no longer a meta tag with the strength it used to have, and Google allows itself the liberty of editing or modifying it by extracting text from the page that it considers most interesting for the user's search intent.

This can cause certain problems, such as generic text appearing in the SERPs, or some text that doesn't really describe or specify what the page content is about in an efficient way. This can also happen with rich results, as happened to this professional.

Although by doing correct HTML tagging, you can get Google to interpret and understand our tables better, sometimes it can have failures and put content from common elements, CTAs, and information that we don't really want in the SERPs.

So, it's true that we can put a meta tag that suggests the best option to Google, but it can take the liberty of putting whatever text it considers in the SERPs and even in rich results. What can an SEO do to have greater control over what appears in the SERPs?

Selecting the text we don't want in the SERPS

We can prevent Google from putting any text in the SERPs with the nosnippet meta tag; however, this can be too radical for us, since in most cases, we will want a meta description (preferably the one we've set), but if it does put something from the text, let it at least be something relevant.

The data-nosnippet attribute prevents that content from appearing in the SERPs of the corresponding page, however it doesn't prevent Google from reading the content or following the links.

What we can do is prevent certain content from appearing in the SERPs, and this is done with an HTML attribute called data-nosnippet, as I have for example in this section:

data nosnippet
Here we see a data-nosnippet attribute that prevents this content from appearing in the SERPs

This attribute can be placed on span, div, and section elements. On other HTML tags, this attribute will be ignored.

The values of this attribute are ignored, so it's not necessary to put a:
="whatever"
If you do put it, it won't have any effect either, it will be treated as an element with the data-nosnippet attribute normally.

So if we see it in code it would be:
<span data-nosnippet>Whatever is inside this element won't be seen in the SERPs</span>
<div data-nosnippet>Whatever is inside this element won't be seen in the SERPs</div>
<section data-nosnippet>Whatever is inside this element won't be seen in the SERPs</section>

Any other variant like:
<p data-nosnippet>No effect</p>
<b data-nosnippet>No effect</b>

Not understanding this?
If you need help with the more technical aspects, book a consultancy session with me: Get real SEO help!

That is, if the attribute is on any tag other than the mentioned div, span, or section, it won't work. Although you can wrap any element within the mentioned ones.

It's not a directive, so Google will try to process it, but it won't always process it before indexing. So it's advisable to leave the attribute even if at first it seems to have had no effect.

AI can also be avoided with data-nosnippet

Remember that this attribute as such needs to be read by Google, so if it's done on a website developed with Javascript, we need to take into account the type of rendering.

Curiosities

Inserting data-nosnippet with a plugin

Bing Update

bing data nosnippet

Google Update

If you like this article, you would help me a lot by sharing my content:
Interested in Advanced SEO Training?

I currently offer advanced SEO training in Spanish. Would you like me to create an English version? Let me know!

Tell me you're interested
You might be interested in other articles:
SEO Articles

If you liked this post, you can always show your appreciation by liking this LinkedIn post about this same article.

Usamos cookies para asegurar que te damos la mejor experiencia en nuestra web. Aquí tienes nuestra política de Cookies.