How to Change WordPress Default Avatar without Plugins and Gravatar?

Today we will talk about How to Change WordPress Default Avatar without Plugins and Gravatar and come custom avatar and learn how you can add your own created custom avatar to default avatar image in your WordPress blog comments.

Read More: How To Remove Comment URL Field from GeneratePress?

Whenever you make comments on any gravatar enabled site such as wordpress blogs, stack overflow etc. then your avatar image is also shown along with those comments. All these sites show by fetching your image from gravatar’s server with the help of your email id.

But if the email address of any commenters is not associated with gravatar then the default avatar images show with the comments of that commenters. 

If you also have a WordPress site, then you can set any one of the 7 default avatar avatars by going to Settings >> discussion in the dashboard and then when a commenter whose email address is not associated with gravatar then that specific default avatar. 

Change WordPress Default Avatar without Plugins and Gravatar

As I told you WordPress default avatar does not make the site look good, so by adding custom avatar image to the default avatar, you can give a professional touch to your site.

In Custom Avatar, you can add your own created cartoon character or logo of your site. I have also set the custom avatar to the default avatar on Gyanians. Let us know how you can add custom avatar.

Step 1: First you design a custom avatar image of 256×256 pixels for your blog and then upload the custom avatar by clicking Media >> Add New in the WordPress dashboard.

Step 2: When the image will be uploaded, copy the file URL of the custom avatar by clicking on the Edit link and paste it in notepad or any other text editor.

Step 3: Now you have to copy the code given below and go to Apprearance >> Editor in the WordPress dashboard and paste it at the bottom of the functions.php file and click on the Update File button.

Note: In the code given below, replace the URL given in front of $myavatar variable with the URL of your uploaded custom avatar which you saved in a text editor in step 2.

add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) 
    $myavatar = "";
    $avatar_defaults[$myavatar] = "My Custom Avatar";
    return $avatar_defaults;

Step 4: Now when you go to Settings >> Discussion in the WordPress dashboard, you can also see your custom avatar in the list of default avatars . Now you have to select your custom avatar and click on save changes button.

Now you will see your custom avatar on your WordPress site on the avatar of those commenters whose email address was not associated with gravatar. add Simple Local Avatars Plugin , if you want to add custom avatar image without code, then you can use this plugin.

I hope you liked this How to Change WordPress Default Avatar without Plugins and Gravatar. If you have any question or suggestion related to this post then comment below and share this post with your friends.

Sharing Is Caring:

Hello Friends, My Name is Roton Kumar Roy (Founder) I am a Full-Time Blogger, Youtuber and Digital Marketer. I have start for those people who want to learn Complete Blogging Course sitting at home for free online.

Leave a Comment