We’ve written an article about how to upload your own image for your own gravatar when you comment on your own site or on other sites that call for the gravatar image. But what about getting rid of the “mystery man” graphic that comes with WordPress by default and uploading your own image? That’s a fabulous question and one that’s actually super easy to do! It does involve getting into the code just a teeny bit but it’s very simple… I promise!
1. Add the custom gravatar function
The first thing we need to do is place a function into your functions.php file that will register your Custom Gravatar. Navigate to Appearance>Editor and select the functions.php file from the top right of your screen. You’ll copy this code below and place it directly above the line that says “//* Register widget areas”.
Please be super careful when you edit this file as one wrong move will give you “the white screen of death” and we don’t want that to happen! Be sure you copy this code in it’s entirety and paste it as is right above the line that says “//* Register widget areas” or at the very bottom of your file.
2. Upload your own custom gravatar image
This step will require that you login via FTP to your site. If you’re not sure how to do this, get with your hosting company as each company has their own settings that you’ll need to know in order to login. If you do know how to login, go ahead and login via FTP. Then navigate to wp-content>themes>YOUR THEME>images.
This is where you will upload your own image being sure that the name of the file is exactly “gravatar.png”. I would recommend creating this graphic around 200×200 so that it is crisp and clean looking on your site! You can use an online editor like Canva for creating this graphic!
3. Officially select your new custom gravatar
The last step to this process is to go set your new gravatar as your default gravatar instead of the old mystery man. Navigate to Settings>Discussion and scroll down to the “Default Avatar” section. You’ll see where you can select your new Custom Gravatar there at the bottom.
Enjoyed this article? Spread the word!