Home > Tips & Tricks > Add Custom Gravatar Image In WordPress Without Plugin

Add Custom Gravatar Image In WordPress Without Plugin

WordPress uses the default Gravatar image if the user does not have an own image to show as a profile photo. Default Gravatar image is a “Mystery Person”. There is more you can change. So, in this trick, we will learn about Custom Gravatar Image In WordPress.

But if the user wants to make own image as a default gravatar. Then you have to do some tricky code in the function file. Of course, you can do it with some plugins. But in this tutorial, I’ll let you know how you can add a custom gravatar image in WordPress without any plugin. It is very simple. You just need to add some lines of code on the function.php file. and you are done.

Firstly, you need to upload your image to the library and copy the file path. We will use this path in the below code.

Let’s see the example below:

Save it and you can check it under Settings » Discussion page. You will see the default gravatar changed with your custom gravatar.

Photo of author

About Aman Mehra

Hey there! I'm Aman Mehra, a full-stack developer with over six years of hands-on experience in the industry. I've dedicated myself to mastering the ins and outs of PHP, WordPress, ReactJS, NodeJS, and AWS, so you can trust me to handle your web development needs with expertise and finesse. In 2021, I decided to share my knowledge and insights with the world by starting this blog. It's been an incredible journey so far, and I've had the opportunity to learn and grow alongside my readers. Whether you're a seasoned developer or just dipping your toes into the world of web development, I'm here to provide valuable content and solutions to help you succeed. So, stick around, explore the blog, and feel free to reach out if you have any questions or suggestions. Together, let's navigate the exciting world of web development!

1 thought on “Add Custom Gravatar Image In WordPress Without Plugin”

Leave a Comment