Custom Default WordPress Avatar

Custom Default WordPress Avatar
I have recently decided to change the custom default WordPress avatar, which is the well known, not-so-elegant “Mystery Man”, into something a little more professional and beautiful for my site.

Custom Default WordPress Avatar

The “Mystery Man” avatar (floating left of the current paragraph) is the default WordPress avatar and it is used whenever a comment is added to your posts by a user who is not registered with Gravatar.

The result for your web-site is that you end up with a list of mixed comments some of which have a nice colorful user avatar attached to them and the rest left only with the grey, monotonous “Mystery Man”.

Wordpress Avatars

Now looking at the list of options provided by WordPress (go to WordPress Admin -> Settings -> Discussion and look at the bottom of the page), again there is nothing I would choose for my default WordPress avatar (floating on the right for your reference).

So the only choice you really have is to set-up your own. Quite a few people have asked me how to do this, so here you go.

How to add a Custom Default WordPress Avatar

To add a custom avatar, place the following code at the bottom of your functions.php file which is located in your theme folder.

Make sure you edit lines 6 and 7 according to your needs. For example, I named my custom default WordPress avatar file “new-avatar.png” and I have uploaded it to my images folder inside my theme. And then the description I gave for my new default avatar is “Genesis”.

Custom Default WordPress AvatarSo if I go again on WordPress Admin -> Settings -> Discussion, the page now looks like the one on the left. All I have to do is select my custom default avatar and click save changes.

From now on comments coming from users not registered with Gravatar will use this icon for your website.

That’s it. Let’s discuss it in the comments below. Did you follow the instructions alright? Did this work for you? Do you have any other way of doing this?


  1. John Cohen says:

    Looks great! Thanks for the tip.

  2. Hey, great looking website!
    Im trying to use this code and the text is appearing “genesis” but NO image?

    Any idea?
    I have checked the obvious like the name etc.

    • Hi Carl,

      Have you uploaded an image in the /images directory of your WordPress installation?
      Have you named it new-avatar.png? Of course you can name it whatever you like and then update the following line of the snippet accordingly:

      $new_avatar = get_stylesheet_directory_uri() . ‘/images/new-avatar.png’;

  3. Ehm… You know that photo at the top? I’m *positive* that is Danbo, the cardboard robot from Yotsuba.

    • Hello Mary,

      I didn’t know that!
      I investigated a little bit after your comment, and it seems that you’re quite right! 🙂

      P.S. By the way: I liked what you’ve done with the design of your website! Very “warm”!


Speak Your Mind