Do you want to change default gravatar logo on WordPress site?

Without a Gravatar, WordPress will always display the same gray “mystery person” when a visitor logs in. You may brand your comments area and make it stand out by changing this stock photo with an image of your choice. In this article we will show how to change default gravatar logo on wordpress using code snippet method.

Steps to Change Default Gravatar Logo on WordPress

Step 1: Go to the WordPress admin dashboard, head to Settings > Discussion.

You can choose from a few more options if you scroll down to the Default Avatar section. Based on the name or email address of the comment author, an algorithm is used in these designs to dynamically produce an avatar. To change the default avatar, select a design using the radio buttons adjacent to it and then click Save Changes.

Change Default Gravatar Logo on WordPress

You must first design the image you want to use as your Gravatar’s default avatar. It should be a square image, say 250 by 250 pixels.

Using web design software like Canva, you may create a new Gravatar image, a logo, or even a stock photo.

Once you’ve finished, navigate to Media > Add New on your WordPress website and upload the image. In this section, you have the option of selecting an image from the WordPress media library or adding a brand-new file from your computer and click to Copy URL to Clipboard.

Change default gravatar on WordPress

Now you will need to edit your WordPress functions.php file, which you can do using cPanel File Manager. Log into the control Pabel Account and select Files > File Manager. Navigate to your WordPress folder, then select public_html> wp-content> themes. Now enter your current theme folder. Select functions.php and click Edit in the command bar. Or you can direct access from WordPress Dashboard. Now go to Appearance and click the Theme File Editor and select the function.php and click edit and paste the following code and Change the URL in $myavatar to the URL you pasted into the text editor earlier and click the update file button.

<?php
add_filter( 'avatar_defaults', 'wpb_new_gravatar' );
function wpb_new_gravatar ($avatar_defaults) {
$myavatar = 'https://techzpad.com/wp-content/uploads/2023/09/download.jpg';
$avatar_defaults[$myavatar] = "Default Gravatar";
return $avatar_defaults;
}
Change default gravatar logo

Now reload the Settings > Discussion page in your WordPress dashboard. You’ll notice that your new default Gravatar image is now available for selection.

Also Read: Fix the Critical Error in WordPress: Step-by-Step Guide

Leave Your Comment