Missing WordPress Gravatar ALT attribute tag? How to fix SEO alt image tag easily now

Wordpress gravatar missing on Wordpress easy fix

Missing WordPress Gravatar ALT attribute tag value causing search engine errors? How to automatically fix the SEO image tag right now and make it go much more quickly.

WordPress does not give Gravatars an ALT tag. Search engines fail to crawl images that do not have a label.

Some of the errors that can be found in WordPress when crawled by search engines include; 

  • The title is missing in the head section of the page.
  • The <img> tag does not have an ALT attribute defined.
  • The page contains multiple titles.
  • Evaluated size of HTML is considered to be over 125 KB and risks not being fully cached.
  • The page is missing meta language information.
  • The title is too short or too long.
  • The <h1> tag is missing.
  • The description is missing in the head section of the page.
  • The description is too long or too short.

In WordPress, by default, Gravatar doesn’t add ALT tag while grasping image from gravatar server.

Missing WordPress Gravatar

WordPress Gravatars – Optimizing a site for SEO and general html5 compliance demands that ALT and TITLE tags inserted for all images presented on the site.

Those with a default WordPress comment section, miss ALT tag for the commenters image and can be a big problem.

How to fix it?

Fixing the missing ALT and the TITLE tag value in the WordPress Gravatars is simple, just by adding below code to the theme’s functions.php file.

function crunchify_gravatar_alt($crunchifyGravatar) {
    if (have_comments()) {
        $alt = get_comment_author();
    else {
        $alt = get_the_author_meta('display_name');
    $crunchifyGravatar = str_replace('alt=\'\'', 'alt=\'Avatar for ' . $alt . '\' title=\'Gravatar for ' . $alt . '\'', $crunchifyGravatar);
    return $crunchifyGravatar;
add_filter('get_avatar', 'crunchify_gravatar_alt');

What do you think?

101 Points
Upvote Downvote
Avatar of Trendous viralate

Written by Trendous viralate

Blogger and Passionate Person who likes to go with viral trends.

Try to replace embedded objects

[SOLVED] Try to replace embedded objects with HTML5 alternatives problem in WordPress

Truehost cloud best services

Truehost Cloud, the Best free web hosting, Free SSL and 1 click cpanel