As an experienced WordPress webmaster, I know how important it is to have a customized and recognizable brand. One easy way to reinforce your brand identity across the web is to change the default Gravatar image on your WordPress site.
In this comprehensive guide, I‘ll walk you step-by-step through two methods to replace the generic mystery person silhouette with your own custom Gravatar image.
Contents
Why Change the Default Gravatar?
First, what exactly is a Gravatar? Gravatar stands for Globally Recognized Avatar, and it‘s an image that follows users across the web.
Gravatar is a free service that allows people to upload profile pictures and attach them to email addresses they use on websites like WordPress. According to Gravatar‘s website, over 2 billion Gravatars are served every day!
WordPress has built-in support for Gravatar avatars. Whenever someone leaves a comment or writes a post, WordPress checks if they have a Gravatar account connected to the email they used. If a Gravatar exists, it will automatically display their profile image.
However, if there is no Gravatar connected to the email, WordPress will show the same generic mystery person or silhouette avatar by default. This is what it looks like:
[Image of default mystery person Gravatar]As you can see, the grey silhouette isn‘t very exciting or engaging. It definitely doesn‘t reinforce branding for most sites.
That‘s why it‘s highly recommended to upload your own custom Gravatar image to use as the default instead.
Benefits of a Customized Default Gravatar
Here are some of the benefits of changing the default Gravatar on your WordPress site:
-
Improves branding – A customized Gravatar reinforces branding and makes your site more visually consistent. For example, you can use your company logo or mascot.
-
Looks more professional – A generic silhouette avatar looks amateurish. A customized Gravatar reflects quality and professionalism.
-
Engages visitors – An illustrated avatar or character is more eye-catching and approachable than a grey silhouette.
-
Improves UX – Seeing the same avatar build familiarity and may encourage visitors to comment more.
-
Easy to do – Uploading a custom Gravatar is a fast and simple way to level-up your visual branding.
Now that you know the benefits, let‘s look at two easy methods to change the default Gravatar image in WordPress.
Method 1: Use a Built-In WordPress Gravatar
The fastest way to customize the default Gravatar is to use one of the built-in options that comes with WordPress.
While you don‘t get to use your own image, it only takes a minute and is better than the mystery person silhouette.
Here are the quick steps:
-
Login to your WordPress dashboard, and go to Settings → Discussion
-
Scroll down until you see the Default Avatar section:
-
Here you‘ll see radio buttons with built-in Gravatars like Mystery, Blank, Wavatar, Identicon, MonsterId, Retro, and more.
-
Click the radio button next to the built-in Gravatar you want to use. The Wavatar and MonsterID options add some color and personality.
-
Scroll down and click Save Changes.
That‘s it! The new default Gravatar you selected will now appear sitewide across your WordPress site.
While not as customized as uploading your own image, this is a super fast way to spice up the default avatar. The built-in Gravatars are better than the mystery person silhouette.
Next, let‘s look at how to upload and use a completely custom Gravatar image.
Method 2: Upload a Custom Gravatar Image
Uploading your own default Gravatar image allows for full creative control and customization. You can reinforce your brand identity with a logo, mascot or other image.
Here is the complete step-by-step process:
Step 1: Create Your Custom Gravatar Image
First, you need to make or find the perfect image to use as your custom default Gravatar.
Based on my 15 years of experience as a webmaster, here are some tips for preparing your image:
-
Format the image as a square like 250×250 pixels. Circular is fine too. This fits the standard Gravatar shape.
-
Keep file size under 100kb for fast performance. JPG or PNG is best.
-
Make sure the image is clear and recognizable at small sizes like 50×50 pixels.
-
Use your logo, brand colors, mascot or other brand assets.
You can create your own custom Gravatar with design software like Canva. Alternatively, pick a suitable stock photo or illustration.
Just make sure it fits your brand identity and looks good at small sizes.
Step 2: Upload the Image to Your WordPress Site
Next, upload your Gravatar image to your WordPress site:
-
Go to Media → Add New in your dashboard.
-
Click Select Files and choose the Gravatar image file from your computer.
-
Click Open to upload it.
-
Once uploaded, click the image thumbnail to open the attachment details.
-
Scroll down and copy the File URL under the image title. We‘ll need this URL later.
The custom Gravatar is now uploaded to your media library. Next, let‘s use it as the default.
Step 3: Add Custom Gravatar Code with WPCode
Now we need to write some code to tell WordPress to use this image as the default Gravatar.
While you could edit your theme‘s functions.php file directly, I don‘t recommend modifying core files. One small mistake could break your whole site.
Instead, I suggest neatly adding the code snippet with the WPCode plugin. The snippet will run sitewide without editing any core files.
Here‘s how to add custom Gravatar code with WPCode:
-
Install and activate the free WPCode plugin.
-
Go to Code Snippets → Add Snippet. Give it a title like "Custom Gravatar".
-
For the Code Type, select PHP Snippet.
-
Paste this code, replacing the URL with your image url:
<?php
add_filter( ‘avatar_defaults‘, ‘custom_gravatar‘ );
function custom_gravatar ($avatar_defaults) {
$myavatar = ‘https://example.com/wp-content/uploads/gravatar.png‘;
$avatar_defaults[$myavatar] = ‘My Custom Gravatar‘;
return $avatar_defaults;
}
?>
-
Configure Auto Insert to enabled and Location to Run Everywhere.
-
Click Save to activate the snippet.
That adds the code needed to use your custom image as the default Gravatar!
Step 4: Set Your Gravatar as the Default
The final step is to set your new Gravatar as the default one:
-
Go back to Settings → Discussion
-
Under Default Avatar, click the radio button next to Custom Gravatar.
-
Click Save Changes at the bottom.
Now your custom Gravatar should appear as the default across your site!
[Image showing custom Gravatar in comments]And that‘s it! Just 4 easy steps to enable a custom default Gravatar in WordPress.
Recap: How to Change the Default Gravatar in WordPress
Here‘s a quick recap of the complete process:
-
Create or find the perfect Gravatar image for your brand.
-
Upload the image to your WordPress site‘s media library.
-
Copy the File URL for the image from the media attachment details.
-
Use WPCode to add a custom Gravatar snippet with your URL.
-
Activate the snippet and set your Gravatar as the default.
Now you have a customized, professional default Gravatar representing your brand!
Expert Tips for Customizing Your Gravatar
Here are some additional pro tips for customizing your default Gravatar in WordPress:
-
For better performance, use a plugin like Gravatar Cache Enabler to cache Gravatars locally. This reduces external requests to Gravatar‘s servers.
-
Test your Gravatar on various screen sizes. Ensure it remains clear and resolves well as small sizes like 50×50 pixels.
-
Make sure your custom Gravatar has sufficient color contrast to comply with WCAG accessibility standards.
-
If using an animated GIF Gravatar, provide a non-animated fallback image for users who opt to disable animations.
-
Consider generating multiple sized Gravatar images locally and uploading the different sizes to your site. This way you can serve optimized resolution images rather than relying on Gravatar‘s dynamic image servers.
-
Review your site analytics to see if there‘s a spike in traffic from a common ISP or email provider. If so, consider using a Gravatar from that domain rather than a custom logo.
-
Change your default Gravatar seasonally or for holidays! This adds fun flair that fits the time of year.
Let me know if you have any other questions about customizing the default Gravatar in WordPress! I‘m always happy to help fellow webmasters implement best practices.