My text used in html to display icons from an icon font are appearing in google search results. How can I stop this from happening?
I have already added area-hidden
and role='img'
, but these do not seem to have any impact.
<span class="material-icons" aria-hidden="true" role="img">search</span>
I have looked around online and mostly found information on how to improve for accessibility purposes, but not so much on how to hide it from googlebot.
Solution
Based on @jake's answer below I went with the following.
HTML
<span class="material-icons" aria-hidden="true" role="img" data-icon="search"></span>
CSS
.material-icons::after{
content: attr(data-icon);
}