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 the founder of Lakewood media. Also an avid landscape and travel photographer.
You may also like
How to fix Webmaster Console crawl errors in WordPress
How to easily fix Google Webmaster Console Errors on your WordPress site using a simple, free plugin. Improve your WordPress site SEO.
0 Comments3 Minutes
How to Improve Your Online Presence
3 steps to improve your digital presence. Whether your business is based online or not, all companies need to have some online presence in the digital age.
0 Comments4 Minutes
How to Hunt for Affordable WordPress Consultancy Services and Actually Hire One
Learn how to find WordPress consultancy services on Google, LinkedIn, and startup directories like Beta List and Product Hunt.
0 Comments14 Minutes
How to create Legal Pages for your WordPress website
Learn how to create Legal Pages in WordPress, use manual approach, WordPress plugins, or hire a Lawyer to create Legal Pages for your WordPress site.
0 Comments13 Minutes
How to Design a Site Experience Users Will Love
It's no secret that a website is basically the face of the company. It is the representation of its story and mission, as well as the company's main point of sale, in most cases.
0 Comments12 Minutes
How to optimise and compress your images
A quick guide to optimising, compressing and resizing your images on your Mac or Windows computer before uploading to your website.
0 Comments8 Minutes