Identicons from Gravatar

You may notice in my comments now for people who don’t have an existing Gravatar I show cool geometric patterns. These are called Identicons and they were originally conceived by Don Park. With a single parameter, you can have the Gravatar API fall back to an identicon or even force it to return one. This works in any size Gravatar supports, up to 512 pixels. Sweet!

48 thoughts on “Identicons from Gravatar

  1. slightly off topic, it would be interesting to make the gravatar click able (for those that doesn’t have one), not many people are tech savvy and have no idea where and how to get a gravatar.

  2. This is a great feature, and so easy to implement. Thanks. (Personally I like the wavatars even better. 🙂 )

    Is there an easy way to get this also in /wp-admin/edit-comments.php ?

  3. I’m still not sure what a Gravitar is or how it can be used or why I might want to use one. And now Indeticons? What are all these things and why would “normal” people find them useful? 🙂


  4. Nice. An explanation of how to do it with WordPress on that site would have been helpful, though, what with WP 2.5 supporting gravatars.

    Anyway, all that has to be done is to add a third parameter to the get_avatar call. So mine looked like this before:
    echo get_avatar($comment, 40);

    And now it looks like this:
    echo get_avatar($comment, 40,’identicon’);

    Just that simple.

  5. Cool! (Half the reason I’m posting this is to see what pattern I get…)
    I’m always looking for enhancements for our blog, perhaps I’ll add this. None of my commenters have gravatars yet, so I don’t show avatars at the moment at all.

  6. Very cool but I’m having one problem with it. With identicon enabled, my trackbacks get a broken image instead of the default as it did without identicon.

  7. @scott johnson: You’ve always been able to define a custom default gravatar, so I’m really unsure why this is useful at all besides providing some alternative globally available default gravatars.

  8. Hmm, never mind. I just realised that the Identicon changes patterns according to the email address provided and is consistent to the email address, allowing for a generated unique and consistently identifiable gravatar for users who don’t have their own. I suppose that might be useful. I prefer using a default to force a stigma of banality on users who don’t have a proper gravatar. >_>

  9. Kevin Paquet – Try this link … WP Identicons

    These identicons aren’t just useful for blogs either, they have uses for lots of other things too. I’m making use of them on a new forum which I have under construction at the moment … Pixo Point forum

    Thank you very much for pointing this feature out Matt. I had never even thought of this concept before. The only solution I had for dealing with non gravatar/avatar people was to leave a bland default image for them all.

  10. Mare – if the commenter doesn’t like the image, they can just upload their own gravatar.

    Charles – gravatars are the little images beside everyones comments here on Matt’s blog. Identicons/wavatars are the little geometric shapes which are displayed when someone hasn’t associated an image with their email address at

    Bryan – Perhaps it would be possible to display an identicon and underneath that, have a small linked text saying “No gravatar”? That way you could have the benefit of the identicon, but with the handy tip for your commenters on how to get one – I suspect that many simply don’t know what gravatar is (yet). I’m not sure how you would detect in advance if an email address was gravatar enabled or not though, but if it is possible, then I think that would be a good idea. Matt, do you know if this is possible?

  11. The purpose of identicons is to expose people who post multiple comments under fake names, without exposing IP addresses. They’ve really reduced the crap at our blog. However, they put a load on the server, despite the fact that they are cached. We can’t figure it out, but on days we activate the plug-in, our server craps out during the noonday rush.

  12. Am I the only one who’s not feeling the whole Gravatar thing?

    I’m not interested in tying comments in with shitty quality MicePace photos, that may or may not have anything to do with the actual commenter.

    On sites with an hefty heaping of comments it just drags the page-load time down needlessly.

    To me it’s one of those things that seemed pretty cool at first but gets old really fast.


    With that said, if we could somehow use an animated GIF of a dancing banana I may come around on the whole Gravatar thing.

  13. Mark – How on earth do identicons help identify spammers? And if you use the built in Gravatar service like Matt is here, the server load will be eliminated as they won’t be processed by your site.

  14. Ryan, the Identicon is derived from the IP address, so spammers run out of those pretty quick (home, work, etc.). Dial-up and the like will somewhat defeat this, but in general, same Identicon, same person, same person, one Identicon.

    Between sites this doesn’t work, because you can set the way the Identicon is generated (number of squares, colors, etc.).

    The built-in Gravitar service is only used for Gravitars, not Identicons. I think we can take Matt’s infatuation with Identicons as a sign that they will be integrated into WordPress in the future, but for now you need the Identicon plug-in, which has had Gravitar support for quite a while, allowing you to use Identicons as a Gravitar fall-back.

  15. Mark – I think you’ve missed the whole concept of how this works.

    The identicons are built into Gravatar, there is no need for a plugin to use them. They work with a default WordPress install and they’re generated from the email address, not the IP address. You encrypt the email address before sending it to gravatar which sends back the associated image. In the case of identicons, it sends back an image based on the email address. SInce the IP address is never sent, there is no way the image could be based on that.

    There are instructions on how to do this on the Gravatar site. Matt probably has some links to it above too (I haven’t checked).

    My new support forum which uses these is now live. They seem to be working quite well. I was expecting some questions from users by now about why on earth they have a crazy looking little monster beside their posts, but as yet no one has questioned it.

    It has been a handy way to add an easy method of identifying posts whilst skim reading. I get a lot of one off posts in my forum and I doubt anyone would bother to enter an avatar for a single post, so having the gravatars for some and little monsters for everyone else has been quite helpful. It adds a nice personalisation to each persons posts and aids in remembering them when they post on another part of the forum.

    Do any of you know of any other examples of these being used on a forum? I haven’t found any but am assuming I’m not the first.

  16. Could someone please write a plugin that causes WordPress to generate Identicons from IP addresses, rather than the email addresses people supply?

    I like it much better when multiple comments from the same computer get the same graphic, and where it is harder for commenters to get a new one just by putting something different in the email box.

    Many thanks,