Skip to main content
Globally Recognized Avatar or Gravatar is a WordPress ’s avatar system which allows an avatar image displayed next to comments made by the user on any WordPress site. The image icon can be a brand representing your company and brand. WordPress comes with a series of default gravatar; this guide shows you how to upload a custom image and use it as the default gravatar in WordPress instead of the default image placeholder.

Upload an image for  gravatar in WordPress

To upload image to Media library,  follow these steps:
  1. Log in to your WordPress site with an administrator account.
  2. On the Dashboard in the left sidebar, click Media:
  3. Click on Add New, and then click on Select Files to select and upload an gravatar image:
  4. The new gravatar image is listed on the Media Library:
  5. Click on the image, copy the File URL. This URL will be used in the code snippet in the upcoming sections:

Add a default gravatar in WordPress

To add a default gravatar,  follow these steps:
  1. On the Dashboard in the left sidebar, click Appearance, and then click Theme Editor:
ImportantYou will not be able to roll back to your earlier Theme configuration after any edits. Make a copy of  the Theme file before proceeding with the edits.
  1. On the Theme Editor, select the Theme you want to edit from the dropdown:
  2. The files for this selected theme are listed on the right column under Theme Files. Click on the file named “functions.php”:
  3. Insert the following code to the end of functions.php file:
  1. Copy the URL from Step 5 inUpload an image for  gravatar and replace URL for $myavatar in the function.Click Update File button to update the file.