GICT knowledge base
How to Set up Gravatar on WordPress
Published
An “avatar” is a small image that appears next to your name when you make comments on blogs or write posts on forums. A “Gravatar” is a globally recognized avatar that will show up whenever you contribute content to sites that have enabled Gravatar, which is a free online service that you can use to manage one or more of your avatars. Your Gravatar corresponds to your email address, so if a website or blog supports the use of Gravatar, then your avatar will automatically show up next to your name, assuming that you entered the same email address that you used when you signed up for Gravatar.
There are several benefits of enabling Gravatar on your WordPress site. As an administrator, integrating Gravatar is quick and easy, and no plugins are required. When you allow visitors to your site to use Gravatar, they won’t have to create a WordPress account to post comments, which means that you don’t have to worry about approving or managing accounts. If the commenter doesn’t have a Gravatar account, the default avatar will show up instead, so you need not force your readers to sign up with Gravatar just to post on your site.
The advantage of Gravatar for end users is that they can manage their avatar(s) from a single location. This is great in the event that a user wants to change his or her avatar. All they have to do is upload a new image to their Gravatar account, and this new image will be updated across all Gravatar-enabled sites where the user has posted a comment.
To enable Gravatar for your WordPress site, login to your WordPress admin area and navigate to Settings > Discussion. Scroll down to the Avatars section, and make sure that the box next to “Show Avatars” is checked. Select the Maximum Rating for the avatars that you’ll allow to be seen on your site. Finally, select the Gravatar Logo for the Default Avatar. Whenever a commenter uses his or her Gravatar email address, the associated avatar will show up next to the comment. If the commenter doesn’t have a Gravatar account, the Gravatar logo will be shown instead.
If you don’t have your own Gravatar, the Gravatar logo will show up next to your name when you reply to comments on your site. Therefore, if you want to have a custom avatar, you need to create an account with Gravatar. It’s a bit confusing because you don’t actually sign up directly through Gravatar. Instead, you must create a free account at wordpress.com (not wordpress.org). Don’t worry about setting up a blog there. All you need are valid account credentials.
Once you’ve created your free wordpress.com account, go to gravatar.com and sign in. If you’re still logged in to your wordpress.com account, you’ll be asked for authorization. Click the Authorize button.
After the authorization step, you can add the image that you’d like to use as your Gravatar. Click the link to add an image.
You can upload your image from a variety of sources.
After uploading your image, you’ll be taken to a screen where you can crop it if necessary. You’ll also be able to preview your avatar before going to the next step. If you’re satisfied with the way it looks, click the Crop and Finish button. Finally, select a rating for your Gravatar. Now you’re ready to use Gravatar on both your WordPress site and anywhere else on the Internet where Gravatar is enabled.
If you want your Gravatar to show up on your own WordPress site, then make sure that the email address for your WordPress admin account is the same as the email address that you used when signing up for Gravatar via wordpress.com. Otherwise, the default avatar will show up when you reply to a comment.
To confirm that everything is working correctly, reply to one of the posts on your blog to see if your Gravatar shows up. In the example below, the Gravatar for “Sharon” (a fictitious administrator for the WordPress demo site used in this tutorial) appears as it should. The other comment shows the default Gravatar logo because “Mr WordPress” doesn’t have a Gravatar.
If you don’t like the looks of the Gravatar logo and don’t want to use it as the default avatar for people who don’t have a Gravatar, then you can either select one of the other default avatar choices in WordPress, or you can create a custom default avatar. Many people create avatars that match the “look and feel” of their websites. You might also choose to use your site’s logo as the default avatar if it has a square or circular shape and would look good in a small size.
To use a custom default avatar, upload your custom avatar to your theme’s “images” folder. If no “images” folder is present, create a new directory called “images” in your theme’s folder, and upload your avatar to this directory. For example, the theme used for this tutorial is TwentyTwelve. So in my FTP client, I would navigate to public_html/wp-content/themes/twentytwelve. There’s no “images” folder associated with that theme, so I created it for the purposes of this demo.
The next step is to go to Appearance > Editor and open the functions.php file. Copy and paste the following code:
// custom default avatar
add_filter( 'avatar_defaults', 'new_default_avatar' );
function new_default_avatar ( $avatar_defaults ) {
$new_avatar_url = get_bloginfo( 'template_directory' ) . '/images/custom-avatar.png';
$avatar_defaults[$new_avatar_url] = 'Custom Default Avatar';
return $avatar_defaults;
}
Make sure that you change “custom-avatar.png” in the code above to the name of the image that you’re uploading. Here’s a screen shot of what the code looks like in the functions.php file. (The PHP code regarding “shortcodes” shown in the screen shot below will not be present in your functions.php file. You’re seeing this code in the screen shot because it’s part of another tutorial: “How to Use Shortcodes in WordPress”.)
When you go back to your Settings > Discussion area, you should now see an option under Default Avatar that shows your Custom Default Avatar. If you just see the words “Custom Default Avatar” but no image, it could be that the path to the image is incorrect, or you just need to clear your web browser’s cache and then reload the page.
Related guides
7 Common Hosting Mistakes Beginners Make (And How to Avoid Them)
7 common hosting mistakes beginners make in 2026: no backups, ignored updates, bad host choice, weak passwords, single point of failure, no staging. With fixes for each.
WordPressWebsite Migration Backup Checklist: What to Save and How to Test
Prepare a website migration backup: inventory files, databases, email and DNS, check archive integrity, test recovery and plan a safe final synchronization.
WordPressCore Web Vitals in 2026: A Practical Fix Guide for Site Owners
Core Web Vitals 2026: practical fixes for LCP, INP, and CLS. Real root causes, what to measure, common misconceptions, and a priority order of fixes for site owners.
WordPressFixing the WordPress “Death Loop”: When Missing Files slow down your site
You’ve just launched your new WordPress site or pushed a big update. In your staging environment, everything ran perfectly.
