Change WordPress Default Avatar

1. You want to change the WordPress default avatar in the comment section. Yes, it can be done. Follow below instructions!

2. Login to your WordPress Dashboard. Under Appearance, click on Editor. Then, click on functions.php. In the functions.php, add the following code and save!

add_filter( 'avatar_defaults', 'newgravatar' );

function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '<directory-of-your-avatar-image>';
$avatar_defaults[$myavatar] = "<your-avatar-name>";
return $avatar_defaults;
}

3. Go to Setting > Discussion. At the Default Avatar, you can see the new Avatar uploaded. Choose the new uploaded Avatar and click Save.

4. Refresh your page!

You May Also Like

Leave a Reply?