Have you ever wondered how to get rid of the “mystery man” graphic that comes with WordPress comments by default and use your own custom image? This is actually super easy to do, although it does involve fiddling around with the coding a bit. But you’ve totally got this! Trust me!
Add the Custom Gravatar Function
The first thing you will need to do is place a function into your functions.php file that will register your custom gravatar. You can do this by navigating to the Appearance > Editor section of your website and selecting the functions.php file from the top right of your screen. Copy the code below and post it directly above the line that says “//* Register widget areas”.
Upload your Custom Gravatar Image
Login via the FTP of your website. If you’re not sure how to do this, get in touch with your hosting company as they can help you. Once you’ve logged into your site via FTP, navigate to wp-content > themes > YOUR THEME > images. This is where you will upload your custom gravatar image. Make sure that the file name is exactly “gravatar.png”.
Select your Custom Gravatar Image
Navigate to Settings > Discussion and scroll down to the “Default Avatar” section. This is where you will see your custom gravatar image. Select it and click save.
If you don’t see your image here, you haven’t uploaded your image in the correct place. Revisit #2 and make sure the file is uploaded correctly!
And that’s it! You’re done!