If you have multiple users in your WordPress site you probably have noticed that icons or gravatars used in replying to comments were white human figure in gray background, mystery man as we call it. For a professional looking site, use the WordPress gravatar.

Many web designers and are particularly interested in making their gravatars creative and reflect what their site is all about. The playful environment in the comment section adds to the overall positive reputation of your site and give people an idea that you are serious about the business you’re in.

WPBeginner has given us a code to make all the legwork easier for us. But first, enable your gravatar before attempting to use the code below. Follow the steps to change your default avatar in WordPress.

Step 1: Access your functions.php file. This is located in your themes folder.
Step 2: Copy and paste the following code in the file.

add_filter( ‘avatar_defaults’, ‘newgravatar’ );

function newgravatar ($avatar_defaults) {

$myavatar = get_bloginfo(‘template_directory’) . ‘/images/gravataricon.gif’;

$avatar_defaults[$myavatar] = “YourAvatarName”;

return $avatar_defaults;


NOTE: /images/gravataricon.gif suggests the location of the image which should be saved in the same folder. Edit YourAvatarName to your preferred name.

Step 3: Upload the File.
Step 4: Login to your WordPress and head on to the Dashboard.
Step 5: Click Discussions under Settings tab.
Step 5: Select your gravatar.
Step 6: Click Save Changes.

You should be all set. Try it for yourself and tell us what you think


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s