Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Display Round Gravatar Images in WordPress

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Display Round Gravatar Images in WordPress

Recently, we showed you how to style your comments layout and how to style your comment form. One of our users emailed us and asked “how did you make your gravatar images round? Are you storing gravatar images locally to get them to be round?” In this article, we will show you how to display round gravatar images in WordPress. We will use the border-radius property of CSS3 to create circular gravatar images.

First thing you need to do is edit your theme’s style.css file. You can do this by using a FTP program or by going to Appearance » Editor in your WordPress admin. Next, you want to add the following code in your CSS file:

.avatar {
border-radius: 50%;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;

This should work on most WordPress themes. However, if this does not work on your theme, then there is probably some plugin or your theme function messing with the default classes used for gravatar in WordPress. In order to find out which css class gravatar images are using in your theme, you need to open a blog post that has comments. Scroll down to the comments section, and right click on the gravatar image to select Inspect Element. It will show you the source code for your gravatar, like this:

Finding css class used by gravatar icon

If the gravatar image has something other than avatar then use that instead of .avatar in the above css code.

We hope that this article helped you display round gravatar images on your WordPress blog. Let us know if you have any questions or feedback by leaving a comment below.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Nataly says:

    hello, It worked, thank you, but, the description appear to high. over the pic, do you know to make it appear at the side of the pic?

  2. Therese says:

    I can’t make it work. :(
    I can’t figure out where exactly to put it, nothing seams to change. I’ve looked at the source code and it’s got avatar just like the example source code.

    • WPBeginner Support says:

      Did you add the CSS in your theme’s stylesheet?

      • ERFmama says:

        Yes I did. I have the Twenty Twelve theme.
        Is there a specific place it has to go? In the style.css

        Edit: Never mind it suddenly worked now! :D

        Can I ask how to change the size of the avatars please? Or have you already written that down somewhere?

        Thank you so much for this!

  3. Daniel says:

    It worked, thank you

  4. Chrissy says:

    Fantastic! Exactly what I was looking for! Thanks you guys rock!

  5. Jacky says:

    THANK YOU so much for this, spent hours trying to accomplish. You provided the most straightforward solution!

  6. Abdul Samad says:

    Bro Thanks For This Code I’m New In WP and I really Enjoying Your Blog Man Thanks For THis And All Tutorials ….

  7. Richie says:

    I was going to pass along this tip and of course tried it first on one of my sites.

    Worked like a champ I simply changed my CSS from px to % for the border moz and webkit.

    Here’s where it got interesting.

    I went to another site, did the same tweak and it didn’t work. After a little head scratching I remembered that I had the plugin WP User Avatar installed on the site that it worked on and didn’t have it installed on the site it didn’t work on.

    I installed the plugin and whalah, works like a champ.

    For both sites I’m using a custom theme built on the Presswork framework.

    Bottom line, I got it to work but only with the plugin.

    Any ideas?

  8. Roselle Celina says:

    Hi there, thanks for this tutorial! It’s working great on chrome and Firefox, but for Safari, I’m getting this same problem:

    Thanks in advance for your help ;)

  9. RW says:

    I agree and I only use IE about 4% of the time but several of my customers are still on 8.


  10. Martin says:

    If somebody uses IE8 does not deserve for round image ;)

  11. RW says:

    Great tip. Please note that IE8 doesn’t natively render round corners (border-radius). You’d need to use javascript, pie, etc… for this but not worth the trouble. Luckily IE9 recognizes current standards…


    • Jim Burnett says:

      I remember the days we were trying to keep IE6 support in the loop. Not it’s IE 8 for rounded corners. Lucky us, IE9 is picking up.

      Then again, FF 3.0 doesn’t support any HTML 5. *sad face*

      Cool CSS trick though!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.