Sometimes, I encounter situations where dynamic content gets crawled by search engines, which I usually don’t want. This just happened on my own website, and I want to show you a simple trick to fix this.
Search engines are displaying content from your website, however, they want. They’re composing the title and description of your page in the SERP based on whatever they find most interesting. This means they won’t just show your provided meta description. Depending on the users search they choose to show a more useful snippet based with more relevant content. But search engines usually listen to headers and HTML attributes
At a Glance
Use the data-nosnippet
on a div
, span
or section
HTML element to prevent content displayed in the SERP of Google. Note that this attribute is an addition from Google and not supported by Bing yet.
Dynamic location information – my case
On my homepage, I show my current location, which I pull daily from Nomads.com’s API. This content could change weekly, and I don’t want it displayed somewhere within the search engine.


For Google, the solution is simple. We can add an HTML attribute to our tag or wrap the full content in it. This will tell Google not to show the content in the SERP. We can’t do more than do such hints we can’t do. In the end, the search engines decide what they want to output and what they support. As of now, Bing for example, isn’t supporting that snippet. There’s is no similar functioning alternative. The closest suggestion is to use the nosnippet meta tag, but this will apply for the full page and isn’t what we want.
Google itself is documenting this attribute and, therefore is an addition by themselves. Maybe some smaller search engines are following that since Google has has quite a monopoly in that area. The tag is called data-nosnippet
. You can simply add this to your span, div or section on the search engine will omit it for the preview or crawling it. Note, the snippet can only be added to those three HTML elements. On others it won’t work.
In my case I’ll just add that to my span element where I output my current location like this:
<span
data-nosnippet
title="My current location is provided by Nomads.com"
>
Currently in Santa Marta, Colombia
</span>
Done. In the future, Google shouldn’t show my current location in the SERP snippet. Fingers crossed 😉