preloader

WordPress Comment Avatars: Setup, Styling, and Common Issues

Comment avatars in WordPress use the same avatar system as author profile photos. Understanding how they work helps you configure Simple Local Avatars and other avatar-related settings correctly for comment sections.

How Comment Avatars Work in WordPress

When a comment is submitted, WordPress stores the commenter’s name and email. When the comment is displayed, WordPress uses the email address to look up a Gravatar (or local avatar if Simple Local Avatars is configured). Commenters who have a Gravatar account associated with their email see their profile photo. Others see a default avatar.

The default avatar is configurable under Settings, then Discussion, then Default Avatar. Options include: Mystery Person (the silhouette), Blank, Gravatar Logo, Identicon (a geometric pattern generated from the email hash), Wavatar, MonsterID, or Retro.

Enabling or Disabling Comment Avatars

Go to Settings, then Discussion. Find Show Avatars. Uncheck this to disable avatars in comments entirely. When disabled, no Gravatar requests are made and no avatar images appear in the comment section. This is the simplest approach if you want to reduce external requests without installing any plugins.

Styling Comment Avatars with CSS

WordPress adds the img.avatar class to all avatar images. Target this in your stylesheet:

/* Round avatars */
img.avatar {
    border-radius: 50%;
    object-fit: cover;
}

/* Specific size in comment list */
.comment-list img.avatar {
    width: 48px;
    height: 48px;
    float: left;
    margin-right: 12px;
    margin-top: 4px;
}

/* Remove border if theme adds one */
img.avatar {
    border: none;
    box-shadow: none;
}

Changing Avatar Size

The avatar size in comments is set in the WordPress get_avatar() function call in your theme’s comments.php template. The default size is 32 or 48 pixels depending on the theme. To change it, find the get_avatar() call in comments.php and modify the size parameter:

// Default WordPress call
echo get_avatar( $comment, 48 ); // 48px square

// Custom size
echo get_avatar( $comment, 64 ); // 64px square

If you use a child theme, copy comments.php from the parent theme to your child theme directory and modify it there.

Using Simple Local Avatars for Registered User Comments

For registered WordPress users who leave comments, Simple Local Avatars replaces their Gravatar with their locally uploaded profile photo. This works automatically once the plugin is active and the user has uploaded a local avatar. Non-registered commenters (who submit comments with just name and email) still use Gravatar since they have no WordPress user profile.

Common Comment Avatar Problems

If avatars are showing inconsistently — some show Gravatar, some show local avatars, some show default: this is expected behaviour when mixing registered users with local avatars and anonymous commenters with Gravatar. Each commenter gets the best available avatar based on their account and Gravatar status.

If all avatars suddenly show the default: check whether a caching plugin is interfering with the get_avatar filter, or whether Simple Local Avatars is active. Deactivating and reactivating the plugin resets the filter hooks.

For custom comment section design including avatar styling, comment threading, and custom comment form fields, a WordPress developer can build a polished commenting experience that fits your site design.

Keep Reading

Previous Post Removing Gravatar from WordPress: Why and How Next Post Understanding PHP Memory Limits in WordPress: What They Mean and How to Fix Them

Need Help With Your WordPress Site?

If you need help with WordPress fixes, plugin issues, theme customization, or development work, feel free to get in touch.

Get a Free Estimate