change default Garvatar in WordPress

Change Default Gravatar on WordPress

Enable Gravatar and change default gravatar on a WordPress site comment section.

Change gravatar to make your WordPress site more beautiful. In this tutorial, we learn about to deal with Gravatars. How to enable/disable gravatar on WordPress comment. Create your gravatar. Change default gravatar on your WordPress comment.

What is Gravatar?

According to Gravatar Site:

AN “AVATAR” IS AN IMAGE THAT REPRESENTS YOU ONLINE—A LITTLE PICTURE THAT APPEARS NEXT TO YOUR NAME WHEN YOU INTERACT WITH WEBSITES.

A GRAVATAR IS A GLOBALLY RECOGNIZED AVATAR. YOU UPLOAD IT AND CREATE YOUR PROFILE JUST ONCE, AND THEN WHEN YOU PARTICIPATE IN ANY GRAVATAR-ENABLED SITE, YOUR GRAVATAR IMAGE WILL AUTOMATICALLY FOLLOW YOU THERE.

GRAVATAR IS A FREE SERVICE FOR SITE OWNERS, DEVELOPERS, AND USERS. IT IS AUTOMATICALLY INCLUDED IN EVERY WORDPRESS.COM ACCOUNT AND IS RUN AND SUPPORTED BY AUTOMATTIC.

default gravatar in wordpress - Change Default Gravatar on WordPress

A Gravatar is an image that follows you from site to site appearing beside your name when you do things like comment or post on a blog. WordPress usually use gravatar image for comment section and author image.

Add your Image to Gravatar

You can add your own image as the gravatar. Once you set your image as a gravatar, it will available all over the world. You set your image as gravatar at Gravatar site. Here you have registered and adding your image. Then it will become your gravatar.

Enable Gravatar In WordPress Comment

To Enable gravatar in WordPress site. Login to site dashboard and go to Settings. Now open Discussion and checked the Avatar Display checkbox. Follow steps given in below image.

enable gravatar on wordpress comments - Change Default Gravatar on WordPress

Here you can enable as well as chose which type of gravatar to show. You can also choose gravatar rating.

How to Change Default Gravatar

You can also set your own gravatar for your site. WordPress allows you to do same. You can easily change default gravatar for your site.

Uploading Your New Gravatar:

Upload Your gravatar image to your site. And copy its URL.

change default gravatar - Change Default Gravatar on WordPress

Add Code to Change Default Gravatar:

Include following code to change default gravatar. You can add this code to your active theme’s functions.php or in child theme’s functions.php file. I suggest adding this code in the child theme. By adding code in the child theme, Change default gravatar will not vanish on theme update.

add_filter( 'avatar_defaults', 'ds_gravatar' );
function ds_gravatar ($avatar_defaults) {
$myavatar = 'http://darshansaroya.com/wp-content/uploads/2017/02/customGravatar.png';
$avatar_defaults[$myavatar] = "Default Gravatar";
return $avatar_defaults;
}

After adding mentioned code in the theme. You can see extra gravatar in Discussion Settings. As shown In below Image:

added default gravatar 1024x389 - Change Default Gravatar on WordPress

Check your default gravatar type to show them on the theme.

Hope you like this tutorial. Please share it to support me.

Subscribe to this blog to get latest post direct into your inbox.

Share the Article

About author
Darshan Saroya

Darshan Saroya

A passionate WordPress Theme Developer. I love to create clean and modern themes, using the power of WordPress. Here I provide the tutorials related to WordPress Development, Core PHP and HTML.

1 Comment

Nisha Prajapat

Nisha Prajapat

November 28, 2017 at 9:57 pm Reply

helpful