This guide helps you easily fix missing Gravatar ALT and title tags that some user experience with their sites. Fixing the missing Gravatar alt description is very easy and you can make this fix without any plugins, all you will need to do is add a function to your MU plugins or to your theme functions.php. You can also add this function using the My Custom Functions plugin, this might be the best option if you don’t fully understand the functions.php file or MU plugins.
Fixing the missing Gravatar is important to make sure your site passes an SEO audit, missing alt descriptions will flag as an error in an SEO audit.
/** * Gravatar Alt Fix */ function lakewood_gravatar_alt($text) { $alt = get_the_author_meta( 'display_name' ); $text = str_replace('alt=\'\'', 'alt=\'Avatar for '.$alt.'\' title=\'Gravatar for '.$alt.'\'',$text); return $text; } add_filter('get_avatar','lakewood_gravatar_alt');
The above function will pull the author display name to use in the alt description and title tag. I have also added some extra text to make it more readable, you can change this.

Adam
Editor of the Lakewood Journal and founder of Lakewood media. Also an avid landscape and travel photographer.
You may also like
How to Attract the Right Audience with SEO Content
In this guide, we share tips on finding content ideas and how to make the most of your online presence so that the right people can find you organically.
0 Comments16 Minutes
The easy way to find SEO Competitors with Free Tools
While doing competitor analysis for keyword research, you will need to find relevant competitors, learn how to find SEO competitors with free SEO tools.
0 Comments9 Minutes
How to create a Link between Google Analytics and Search Console
Learn how to integrate Google Analytics with Search Console and obtain search data right in the Analytics' dashboard of your site.
0 Comments9 Minutes
How to do Keyword Research with free SEO tools
Learn how to perform keyword research with free SEO tools, learn how to obtain data with free tools, chrome extensions, and Google auto-complete feature.
0 Comments13 Minutes