Change the default avatar in WordPress

If you’ve ever wanted to change the default avatar in WordPress, all you need is a quick filter in functions.php that inserts and names your new avatar. Once you add the markup below, you’ll see your new avatar type listed in wp-admin > Settings > Discussion along with the choices like Identicons and MonsterID. The code:

[code id="585"]

This is a pretty simple one. Our function newavatar() is hooked to the avatar_defaults, and we simply add our new avatar choice, which includes a path to the image URL along with a title (pigs!). At the end, we return the defaults, which has been impregnated with our new custom avatar, and no one is ever the wiser!

DATE2nd February, 2012

CATEGORIESQuick Tips

TAGS , , ,

3 Comments

  1. Hi Clark. I have seen and used this before, but now I am experiencing that now matter what URL you send, WP puts a http://gravatar.com in front of it, which breaks the image on the Discussion Settings page (and I presume everywhere else). Have you seen this? Do you have any idea how to get around this?

  2. Hi Kathy,

    I have your same problem, have you found the solution? Really curious about that!

  3. I believe this code goes to your functions.php in your theme. And when you select an default avatar, you will see a new option to select.

Leave a Reply