/* Change Default Gravatar WordPress */
function wpflt_default_gravatar ($avatar_defaults) {
$myavatar = 'https://wpf.jaxn.in/wp-media/gravwpfilters.png';
$avatar_defaults[$myavatar] = "Site Gravatar";
return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'wpflt_default_gravatar' );
Replace the default WordPress Gravatar with any Custom Image using this code. By default, WordPress shows its default Placeholder Image for users in your comment list who don’t have a gravatar image.
If your users have already set their own gravatar image, WordPress will fetch the same. If any of your commenting users haven’t set their gravatar, then the uploaded image will be shown.
Add the above code to your child theme’s functions.php. Before that, create your own gravatar image in PNG format. Keep it light. Upload it to your media library and copy the URL.
Paste the copied URL in 3 by replacing the existing one.
As soon as you save the file, visit, Settings> Discussion> Default Gravatar. You should see the new uploaded image named ‘Site Gravatar’. Select and Save changes.
Also Read,