Today whilst surfing the net i came across this site redd-design.com which had a post which matched exactly what i was wanting todo which was setup the Alt tag for gravatar to rid my site of “missing or empty alt tag” warnings when testing with certain tools.
The site above did not fix this for me but did put me in the right direction and now i’m pleased to share my fix here.
Updated 27/12/2012 with function instead of hack.
Place the following in your themes functions.php instead of the hack in red below as modifying core wordpress files is not recommended and any changes made could be lost when updating wordpress itself.
function replace_content($text)
{
$alt = get_comment_author($id_or_email);
$text = str_replace('alt=\'\'', 'alt=\''.$alt.'\'',$text);
return $text;
}
add_filter('get_avatar','replace_content');
So head to “wp-includes/pluggable.php” and search for the line
$safe_alt = '';
and replace it with
$safe_alt = get_comment_author($id_or_email);
Now instead of an empty Alt tag accompanying all your comments the comment authors name will be displayed there instead.
See http://codex.wordpress.org/Function_Reference/comment_author for other options to display instead of the comment authors name like say there link if they provide one.
Hope this helps,


Thanks a lot for tracking me down and pointing me to this answer.
Hey Russ,
No problem Please see updated code with function instead of hack.
All the best,
Ian