How do I stop people from Pinning my Author Image?

Need help with the Tech-side of blogging? Join my Facebook Group and get some answers.
~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~

If you want to stop people from pinning the Gravatar image from your Author box or comments, you can add the following code to your WordPress functions.php file.

Disclosure: Please note that this article may contain affiliate links. You can read the full disclosure here.

If you do not know how to access your functions.php see this post for instructions.

function wpba_gravatar_nopin($wpbaGravatar) {
if (have_comments()) {
$alt = get_comment_author();
}
else {
$alt = get_the_author_meta('display_name');
}
$wpbaGravatar = str_replace('alt=\'\'', 'alt=\'Avatar for ' . $alt . '\' title=\'Gravatar for ' . $alt . '\' data-pin-nopin=\'true\'', $wpbaGravatar);
return $wpbaGravatar;
}
add_filter('get_avatar', 'wpba_gravatar_nopin');

The code above is modified from this post here to add the alt text to your gravatar on Crunchify, modified above to add the nopin option to your author and comment gravatar images.

Note – if someone uses the Tailwind extension, enters your URL on Pinterest directly or another method to pin your post the images may still be pinnable.

Got blogging questions? Join my Facebook group here WP Blogger Assist Questions

Avatar for Tara, WP Blogger Assist

Tara, WP Blogger Assist

I have over 15 years experience in IT. Over this time: managing server infrastructure, building websites and more. This website is dedicated to helping WordPress bloggers with setting up their blogs and websites; optimizing fast page loading, SEO and social media marketing - such as; Pinterest, Facebook and more.

Leave a Reply

Your email address will not be published. Required fields are marked *