How to create and add custom default avatar in wordpress – Gravatar

How to change custom default Gravatar in wordpressCommenting system in wordpress is a great way to converse with other users and when the commenter has an image the conversation becomes more interesting. All wordpress blogs uses Gravatar for comments to display avatar for each user. Each avatar is generated based on their email address that they used in Using Gravatar is one way to show your identity across the World Wide Web. Learn more about what, why and how to use Gravatar in WordPress. Here we will see how to create and add custom default avatar in wordpress.

There are many still don’t have a pic at Gravatar. A commenter without an image at Gravatar simply ends up seeing mystery man instead of his/her face. If you are running a wordpress blog then you can see too many mystery faces in comments area. If are you bored with the mystery man then change the default Gravatar in wordpress and add your own custom default avatar. Here in simple easy steps we will show you how to create and add custom default avatar in wordpress.

Use of adding a custom Avatar

How to create and add custom default avatar in wordpressBefore changing the default Gravatar in wordpress let’s see the use of creating and adding custom avatar. In your wordpress dashboard go to settings >> Discussions and at the bottom you can see 7 default avatar.

If a user makes a comment without his/her image then wordpress simply displays these custom avatars. This is something other commenters don’t like to see as well as they can’t identify his/ her face. So instead of these custom avatars you can just add your site logo for branding just like the Gravatar logo.

Another reason is, all these custom avatar is not hosted in your server. All these image calls from remote Gravatar servers. This is not going to slow down your site, but the images hosted in your server loads quickly than the image hosted in remote server.

Moreover all these default custom avatar gets bored after seeing in many websites, especially the Mystery man. So are you ready to change the default Gravatar in wordpress.

How to create a custom default avatar in WordPress

How to create and add custom default avatar in wordpressWe will provide you a code (no worries we will guide you) that adds one more avatar to list the of 7 default avatars. Before adding the code you must create a custom avatar for yourself. Use your site logo or if you have more designing skills then create a nice image and save it as custom-avatar.png. Also you can get free to use icon sets available for download in many sites. Have the image dimensions equal like 35 X 35, 60 X 60, 70 X 70 etc. You have created your custom avatar, now we need to add it in your wordpress site.

How to add custom default avatar in wordpress

To add custom default avatar in wordpress just copy the code below. Now go to your wordpress dashboard appearance >> Editor and then select Theme Functions (functions.php). Then add the code at the bottom of functions.php file. If you see the closing tag ?> then just add the code before that tag or else simply add it below.

//**Custom Gravatar**//
add_filter( 'avatar_defaults', 'new_custom_default_gravatar' );
function new_custom_default_gravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '/images/custom-avatar.png';
$avatar_defaults[$myavatar] = "Custom Default Gravatar";
return $avatar_defaults;

Some themes do not allow you to add code in functions.php. If so then create a custom-functions.php file and add the above code and upload it to your theme folder using FTP.

Now you need to call the image and to do so upload the custom-avatar.png image in your theme folder. That is in wp-content/themes/your-template-name/images/custom-avatar.png.

How to create and add custom default avatar in wordpress - Change default Gravatar

After this process go to discussion settings in your wordpress dashboard. At the bottom you can see your custom avatar that is added in that default list. Select that and save changes, now your site displays custom default Gravatar for users who don’t have a custom avatar.

Plugins to change default Gravatar in wordpress

Other than adding codes there are two plugins in which you can change your default Gravatar. Add new default avatar plugin adds a new default avatar in your wordpress discussion settings. You can choose the image URL and display your own custom Gravatar. Another plugin is wp user avatar is which you will have the option to display your own custom avatar even though if the user has an image in Gravatar.

Hope this post provided you a detailed note on how to create and add custom default avatar in wordpress. As well as changing the default Gravatar in wordpress made simpler with those two plugins. Share it and leave your comments, let’s see some faces instead of Blog Time Now logo.