# How to Fix Missing Gravatar Alt Tag Value in WordPress? Easy Guide

- Link: https://simplyirfan.com/thats-how-to-fix-missing-gravatar-alt-tag-value-in-wordpress/
- Published: 2025-05-05T09:45:42-04:00
- Author: Irfan

[  Stay connected via Google News ](https://www.google.com/preferences/source?q=simplyirfan.com)

Fix Missing Gravatar Alt Tag Value in WordPress: If you’ve done an SEO audit on 
your WordPress website, you might have found that you’re getting some alert for 
missing alt tags in your gravatar author photo. This is an increasingly common issue,
and I am optimistic that in a forthcoming update WordPress will fix it. Before then,
I have created this short guide to show you to have a simple function this will 
add alt tags to your Gravatars.

This guide is really simple, but you need to know PHP and do not have to do anything,
just copy it and paste it. I suggest you to copy and paste the following code into
the functions.php child theme, or you can use a plugin or [WordPress code snippets](https://wordpress.org/plugins/code-snippets/).

## The Function To Add Alt Tags To Gravatar Images

This is the function you would use to connect the gravatar picture. In this case,
the alt tag would be “This is Irfan” because my name is ‘Irfan.’ The feature uses
the Gravatar user’s screen name to apply a related alt-tag to the Gravatar.

    ```wp-block-code
    /**
    * Gravatar Alt Fix
    */
    function simplyirfan_gravatar_alt($text) {
    $alt = get_the_author_meta( 'display_name' );
    $text = str_replace('alt=\'\'', 'alt=\'This is '.$alt.'\' title=\'This is '.$alt.'\'',$text);
    return $text;
    }
    add_filter('get_avatar','simplyirfan_gravatar_alt');
    ```

![Fix Missing Gravatar Alt Tag Value in WordPress](https://simplyirfan.com/wp-content/
uploads/2020/12/Fix-Missing-Gravatar-Alt-Tag-Value-in-WordPress.png "How to Fix 
Missing Gravatar Alt Tag Value in WordPress? Easy Guide 1")

Also READ,

 * [SEO Secrets](https://simplyirfan.com/seo-secrets/)
 * [Benefits of SEO](https://simplyirfan.com/seo-benefits-2020/)
 * [How to fix Camera issues in snapchat](https://simplyirfan.com/how-to-troubleshoot-snapchat-camera-issues/)
 * [Complete guide to sunglasses emoji on snapchat](https://simplyirfan.com/sunglasses-emoji-on-snapchat/)
 * [How to change username on snapchat](https://simplyirfan.com/how-to-change-snapchat-username/)
 * [SEO Quotes](https://simplyirfan.com/seo-quotes-to-motivate-your-seo-campaign/)

 [  Stay connected via Google News ](https://www.google.com/preferences/source?q=simplyirfan.com)
