What is Default Gravatar and Why Change it?
Gravatar is a web service created and run by WordPress co-founder Matt Mullenweg’s company called Automattic. It allows anyone to create a profile and associate avatar images to their email addresses.
This avatar image is then displayed on all WordPress blogs where users leave comments or write blog posts.
All WordPress sites come with built-in support for gravatars and automatically show users’ avatars when they write posts or leave comments.
However, if a user doesn’t have a gravatar image, then WordPress automatically shows the default gravatar image. The default option is to show an image called mystery man. It looks like this:
If you don’t want to use the mystery man as default image, then you can change it to your own branded image.
Having said that, let’s see how you can change the default gravatar image on your WordPress site, so you can use a custom default gravatar image.
Changing Default Gravatar Image in WordPress
First, you need to visit Settings » Discussion page and scroll down to Avatars section. This is where you can configure and change gravatar settings on your WordPress site.
You will notice that there are a few choices available under the default avatar option. These avatars are used when a user does not have a gravatar associated with their email address.
Out of the box WordPress uses the mystery person icon as the default gravatar. You can change that to blank or gravatar logo.
There are few other options available as well. These are automatically generated images in different designs. These images use comment author’s name or email address to mathematically generate a unique gravatar image.
Don’t forget to click on the save changes button after changing your default gravatar.
Using Custom Default Gravatar Image in WordPress
WordPress also allows you to use your own default gravatar images. Here is how you can easily add your own custom default gravatar image in WordPress.
First you need to create an image that you want to use as the default gravatar. This image should be a square, like 250×250 pixels.
Next, you need to upload this image to your WordPress site. Head over to Media » Add New and upload your custom default gravatar image.
After the image is uploaded, you need to click on the Edit link next to the image.
WordPress will now open your image for editing. You need to just copy the image file URL and paste it in a plain text editor like Notepad.
Now you need to add some code to your WordPress site.
Add the following code to your theme’s functions.php file or a site-specific plugin.
Don’t forget to replace
$myavatar value to the URL of the custom gravatar image you uploaded earlier.
You can now visit Settings » Discussion page and you will notice your custom default avatar added to default avatar choices.
Select your custom default avatar image, and then click on the save changes button.
WordPress will now use your image for users who don’t have their gravatar associated with their email addresses.