PHPMatters Help You Better Hosting Your PHP-based Sites
How to Create Custom WordPress Gravatar

How to Create Custom WordPress Gravatar

The Avatar is a special tiny image that will be displayed in the comment section of a blog post after you leaving some commenting words on it. If you are a WordPress user, however, this special picture is called as Gravatar – a particular type of Avatar that represents you online by appearing next to your name if you interact with other WordPress powered websites.

In the following, we’d like to introduce a guide about how to create custom WordPress Gravatar no matter you are a website administrator or a website reader.

Custom WordPress Gravatar for Website Readers

Being a common online user, the utilization of WordPress Gravatar allows you to comment on any WordPress websites without the need of registration but just via the Gravatar system, along with a customized image that can be updated across multiple websites.

To use it, you firstly need to register a account, which is the only channel for signing in to Gravatar. Then, click this link to start.

Sign in Gravatar

After clicking the “sign in with” link and granting the authority, you can pick the email that connects your WordPress Gravatar. Note that the primary option is the email you have used for your account.

Now, you need to assign an image as the custom Gravatar for your email address. Otherwise, a default one will be used based on the settings of websites you are going to comment on.

Add Gravatar Image

Then, you will be required to crop the image to the best size. The live preview section clearly shows what your Gravatar will look like. Once you are satisfied, click the Crop and Finish button. Lastly, you have to choose the Gravatar ratings. Note that the “G rated” one is the common choice for all websites with any reader groups.

It’s done. Now, you can comment on any WordPress websites easily, with your custom Gravatar showcased next to your name.

Custom WordPress Gravatar for Administrators

If you are a WordPress website owner, you may constantly find a “Mystery Person” Avatar showcased for some of your commentators who are leaving words on your posts. These people simply do not have pictures at WordPress Gravatar, so the system simply gives them a default one in the comment section.

In fact, if you navigate to your WordPress admin and go to the Discussion area under the Settings tab, you can find 7 Gravatars that are pre-installed with WordPress, calling from the remote Gravatar servers.

Default Gravatar

If none of these pictures can satisfy you as your default Gravatar, you can upload a custom one that adds more values to your website design and branding.

To achieve this, the most time-saving way is by using the code in the function.php file of your WordPress template. We have showcased the screenshot of required coding stuff in the following. If you need to copy them, simply go to this WordPress Codex page and scroll down to the bottom. Do not forget to replace the values of image path and name within the lines of coding.

Add Custom Gravatar with Code

Then, you can go to your dashboard and click the Editor button under the Appearance tab. Here, you can find the function.php file (Theme Functions). Open it and paste the code at the bottom of the file. After saving the setting, you can find your custom Gravatar showcased at the Avatar section in the Discussion Settings page of your admin. Now, you can choose it for your commentators not registered with Gravatar.

Using Add New Default Avatar Plugin

If you are a newbie who do not want to change any coding in your WordPress site or if your current theme does not allow you to add codes in the function.php file, you can also use the Add New Default Avatar plugin to create custom WordPress Gravatar.

After installing it, you can go back to your Discussion settings page and navigate to the bottom. Here, you can find a new area allowing you to add new default Gravatar.

Add New Default Avatar

Special Note – Upload the Image with Right Dimension

No matter you are creating your custom Gravatar using codes or using plugins, you have to make sure that the dimension of your uploaded image is proper.

According to WordPress codex, the default Gravatar size is 96×96. It does not mean that you can upload an image with this size. After all, many WordPress templates today have already changed the size of Gravatar to better suit the overall website design.

In this case, the best resolution is to go to the front-end of your website, figuring out the exact size of the Gravatar that already exists in your comment section using some screenshot tools such as Nimbus Screenshot. Then, you can upload a special image as your Gravatar featuring with the right dimension. Note that the PNG format works the best.