How to change the default Gravatar on WordPress508

Author: InfoBeep - September 11, 2017 | subject to copyright

What is default gravatar and why change it?

Gravatar allows anyone to create a profile and avatar images to the given profile. The avatar image is displayed on WordPress blogs wherever the user comments or write blogs.

If user doesn’t have an avatar image, WordPress automatically shows the default avatar of that user. The default image is also called mystery man. Demo image of mystery man is below:
How to change the default Gravatar on WordPress

If you want to change the default Gravatar other than mystery man. Here, is how you can do it.

 

Changing default Gravatar image in WordPress

In order to change default Gravatar image in WordPress, follow the steps below:

  1. Go to Settings > Discussion, you will be able to see the page as shown in the picture:
    How to change the default Gravatar on WordPress
  2. As shown in the picture above, you can change different images as your gravatar images. Select as per your requirement and save it.

 

Using custom default Gravatar image in WordPress

You need to follow the steps below to use your custom image as default gravatar image:

  1. Create a square image, (250*250 pixels)
  2. Go to Media > Add New and upload your gravatar image.
  3. After upload, click on edit link. See the demo image below:
    How to change the default Gravatar on WordPress
  4. Now, copy the URL link of your uploaded gravatar image as given below:
    How to change the default Gravatar on WordPress

 

  1. Add the code below to your functions.php file or a site-specific plugin.

add_filter( 'avatar_defaults', 'ib_new_gravatar' );

function ib_new_gravatar ($avatar_defaults) {

$myavatar = 'https://infobeep.info/wp-content/uploads/2017/01/infobeep-gravatar.png';

$avatar_defaults[$myavatar] = "Default Gravatar";

return $avatar_defaults;

}

 

(note: In this code, we have our gravatar link as https://infobeep.info/wp-content/uploads/2017/01/infobeep-gravatar.png, change the URL with your gravatar URL.)

 

  1. Now, go to Settings > Discussion, you should now be able to see your custom gravatar as an option.
    How to change the default Gravatar on WordPress
  2. Now, select you custom gravatar and save changes.