Using hash generated avatars
Ben of frogstr had recently posted on how gravatar can help your brand. It is indeed nice service (I am going to explain in details below) but taking in account people that simply hadn’t bothered to setup gravatar yet there is one awesome way to fix no-avatars problem on your blog.
That is pulling hash generated avatars from gravatar service.
Email hash
I had posted on some hash tricks in the past. Repeating basic idea – hashing is getting long weird looking string of characters from some input. In case of gravatar input for hash is email address you fill in when making comments on blogs. Hash allows to use your email for gravatar service without exposing it – it is not possible to calculate email from hash.
Gravatar service
Gravatar is online service owned by Automattic (developers of WordPress) that serves avatar images responding to specially formed URLs with MD5 hash in them.
Basically:
- Register on gravatar site with your email and upload image for avatar.
- Every gravatar-enabled blog will start showing that image near your comments.
Cool, isn’t it? Problem is for every person with gravatar there are hundreds without one. So comment discussions still look faceless with occasional gravatar splashes.
Inner workings
I said above that gravatar request is made with URL. So to see it I need hash email. I can either get it from gravatar image properties (right-clicking image in browser is usual way to get there) or go to online MD5 generator and calculate it.
Hash for my personal email is f2b6e0c8a09d8faadb50d56890e2528c. When I comment request is made to the following link: http://www.gravatar.com/avatar/f2b6e0c8a09d8faadb50d56890e2528c.jpg
And my gravatar is downloaded and pasted in page.
![]()
But what if I have no gravatar?
My contact email for this blog is contact@rarst.net. Its hash is ab89ce39f47b327f1c85e4019e865a71. And link: http://www.gravatar.com/avatar/ab89ce39f47b327f1c85e4019e865a71.jpg
gets ugly placeholder image:
![]()
Here come hash generated avatars!
Adding some parameters to URL makes gravatar send not an boring image but one generated from hash. So different hashes get different images, but as long as same email is used and same hash is calculated – same image is going to show for it.
Identicon http://www.gravatar.com/avatar/ab89ce39f47b327f1c85e4019e865a71.jpg?d=identicon
![]()
MonsterID http://www.gravatar.com/avatar/ab89ce39f47b327f1c85e4019e865a71.jpg?d=monsterid
![]()
Wavatar http://www.gravatar.com/avatar/ab89ce39f47b327f1c85e4019e865a71.jpg?d=wavatar
![]()
How to use them
Go to Settings > Discussion in WordPress admin area. It has setting that allows to choose what to show instead of placeholder image.
![]()
If it doesn’t work with your theme or you use different platform look for solutions in gravatar implementer’s guide and using gravatars WordPress Codex page.
Overall
Gravatars complemented by hash generated versions are very nice visual clue for comments in blog. It allows to easily spot active commentators or acquaintances even across different blogs.
MonsterID and Wavatar are bit too… Weird. :) I went with Identicon for this blog. So if you don’t have gravatar yet – comment below this post and check out cool geometrical pattern it assigns to you.



Thanks for the luv Rarst. This is a really nice post and that will actually let me put something else than the “Mystery Man” as the default Gravatar! I’m thinking about making a custom one…
@Ben
Mystery man is soo boring. :) Try identicons, I completely like them.
By the way setting blank has pretty nice effect too if place for gravatar is not obviously visual. No default placeholders but still showing gravatars for those who have them.
What a great idea. I just set my blog to identicons and they look just wonderful. I love the fact that there is now a bit more color and everyone without a gravatar will still have a different graphic shown. I implemented this and it immediately changed all the previous ‘mystery man’ graphics. Thanks for a great tip.
@Lyndi
Glad to be of use. :) Sometimes default options are not the best ones.
Interesting article, i have bookmarked your blog for future referrence, thanks
@gry planszowe
Glad you liked it, welcome to blog. :)