How to markup advertisement to have it excluded from search?
My specific problem is that I have the below code outside the main
and article
elements on my pages. Going from a purely semantic to a real world problem: Sharing a link to my page on Google+, Facebook, and Twitter will use the advertisement image to represent the content.
<aside>
<a href="http://www.example.com/ad" rel="nofollow">
<img src="/example_com.png" /></a>
</aside>
The social networks’ documentation tells me how to specify which image to use. But for much of my content, no image would be the best option. None of them explain how to achieve that.
For Google Custom Searches I could have tweaked my code to <aside class="nocontent">
to achieve this. But according to Google’s documentation, this does not affect normal web search. Testing shows that none of the social networks respect this either.
If the advertisement is not part of your content (instead of, e.g., a blog post about a product), using the
aside
element would be correct from the HTML perspective:If some third party services simply scrape any image if you don’t provide one with semantic annotations (e.g. in RDFa, Microdata or Metatags), I’d say it’s a bad service.
You could try some "hacks" and then check if these services stop using the ad image:
iframe
element for the advertisement (maybe the services don’t checkiframe
content)object
element instead ofimg
(maybe the services only look forimg
)Hmm if I understand you right you want to declare the semantic markup of ads non indexable.
Here's the first place I checked-> http://schema.org/WPAdBlock