Skip to content
Back to blog

How to Change the Default Gravatar Image Size in WordPress

Profile photos play a big role in making comments and author boxes feel personal and trustworthy. In many themes, however, the built‑in avatar size doesn’t quite...

Michał Mikołaszek
Michał Mikołaszek
Sep 14, 2026
9 min read
How to Change the Default Gravatar Image Size in WordPressContent entirely generated by artificial intelligenceContent entirely generated by artificial intelligenceThis content was entirely generated by artificial intelligence, with no human element (other than the prompt).

Profile photos play a big role in making comments and author boxes feel personal and trustworthy. In many themes, however, the built‑in avatar size doesn’t quite fit the design. The good news is that you can fully control the default Gravatar image size in WordPress with just a few tweaks to your settings, template files, and functions.

How Gravatar Images Work in WordPress

WordPress uses the Gravatar service to display user avatars in comment sections, author bios, and sometimes in widgets. When a user’s email address is associated with a Gravatar account, their profile image is automatically fetched and displayed on your site.

There are three main places where you’ll typically see Gravatar images:

  • Comment avatars in the discussion area under posts.
  • Author avatars in the post meta or dedicated author box.
  • User avatars in custom templates or widgets added by your theme or plugins.

Each of these areas relies on the same core WordPress APIs, which allow you to control the default Gravatar size globally or locally for specific areas.

Understanding How WordPress Sets the Default Gravatar Size

By default, WordPress uses a 32px square for comment avatars. However, under the hood there are a few different layers that can affect the final Gravatar image size:

  • Theme templates (for example, comments.php) often specify a size in wp_list_comments() or in get_avatar() calls.
  • Filters like avatar_defaults and get_avatar can change how avatars are rendered.
  • Discussion settings in the dashboard control whether avatars are shown at all, but not their size.

Because of this, changing the default Gravatar image size is usually a combination of configuration and small code adjustments. You can either set a global default or override sizes in specific spots.

Changing Gravatar Size Using WordPress Settings and Theme Options

Some modern themes and page builders provide controls for avatar size directly in their options. This is the easiest method if it’s available.

Check Your Theme’s Customizer Options

Start by looking for avatar or author box settings in your theme:

  • Go to Appearance > Customize.
  • Inspect sections like Blog, Single Post, Layout, or Author Box.
  • Look for an option labeled “Avatar size,” “Author image size,” or “Comment avatar size.”

If your theme exposes this, you can adjust the Gravatar size site‑wide or per area without touching code. The theme will handle the corresponding template and CSS changes automatically.

Use a Plugin to Control Avatar Size

If your theme doesn’t offer built‑in options, certain comment or author box plugins allow you to define a default Gravatar size. Common examples include:

  • Comment enhancement plugins with avatar styling options.
  • Author box plugins that let you pick an avatar dimension for the bio section.

These plugins typically wrap the core WordPress functions and provide a user interface on top of them.

Manually Changing the Default Gravatar Image Size in Code

For full control and predictable results, it’s often best to adjust the avatar size in your theme’s code. This approach is more technical but gives you consistent behavior across your entire site.

Always Use a Child Theme or Custom Snippet Plugin

Before making any code changes, ensure your modifications are update‑safe:

  • Create and activate a child theme, and make changes there instead of editing a parent theme directly.
  • Alternatively, use a code snippet plugin to add small PHP functions without editing theme files.

This prevents your custom Gravatar image size settings from being overwritten when you update your theme.

Change Comment Avatar Size via wp_list_comments()

Most comment templates use the wp_list_comments() function to output the comment list along with avatars. This function accepts an array of arguments, including 'avatar_size'.

Open your theme’s comments.php file (or equivalent template) and look for a line similar to:

<?php
wp_list_comments( array(
    'style'      => 'ol',
    'short_ping' => true,
) );
?>

To change the default Gravatar size for comment avatars, add the 'avatar_size' argument:

<?php
wp_list_comments( array(
    'style'       => 'ol',
    'short_ping'  => true,
    'avatar_size' => 64, // Set your desired size in pixels.
) );
?>

This will make all comment avatars render as 64×64 pixels, or whatever size you specify.

Change Author Avatar Size with get_avatar()

Author bios, post meta sections, and custom templates often call avatars directly with get_avatar(). The function’s second parameter controls the size.

A common pattern looks like this:

<?php echo get_avatar( get_the_author_meta( 'ID' ) ); ?>

To define a new default size for this Gravatar image, pass the size in pixels as the second argument:

<?php echo get_avatar( get_the_author_meta( 'ID' ), 96 ); ?>

Now every time this template is used, the author’s Gravatar will be displayed at 96×96 pixels.

Apply a Global Default Gravatar Size with a Filter

If you want a global default size for all avatars where no explicit size is set, you can use the get_avatar filter. This lets you intercept the avatar HTML and override the size parameter.

Add the following code to your child theme’s functions.php file or a custom snippets plugin:

function mysite_default_gravatar_size( $avatar, $id_or_email, $args ) {
    // Only modify when a size isn't already explicitly defined.
    if ( empty( $args['size'] ) || 32 === (int) $args['size'] ) {
        $args['size'] = 80;
        $avatar = get_avatar( $id_or_email, $args['size'], $args['default'], $args['alt'], $args );
    }

    return $avatar;
}
add_filter( 'get_avatar', 'mysite_default_gravatar_size', 10, 3 );

This example upgrades the default Gravatar image size to 80px wherever a specific size has not already been provided. You can adjust the 80 to match your design needs.

Ensuring Your Gravatars Look Good with CSS

Changing the default Gravatar size in PHP controls the image request and the HTML markup, but you might still need a bit of CSS to ensure the avatars display perfectly across your layout.

Align Avatar Size with Theme Layout

Even when the correct size is requested from Gravatar, themes may constrain images through CSS. For instance, a theme might enforce a smaller width:

.comment-author .avatar {
    width: 32px;
    height: 32px;
}

If you’ve changed the default Gravatar image size to 64px but the above CSS still exists, the image will visually render at 32px, often looking soft or cramped.

Update your CSS to match the new size:

.comment-author .avatar {
    width: 64px;
    height: 64px;
}

The same applies to avatar images in author boxes or widgets; look for selectors like .author-avatar, .author-box .avatar, or .widget .avatar.

Use Responsive Styles for Flexible Layouts

On modern, responsive designs, it’s often better to avoid hard‑coding pixel dimensions in CSS. Instead, you can let the image scale with the container while still requesting a sufficiently large Gravatar size.

For example:

.comment-author .avatar {
    max-width: 64px;
    height: auto;
    border-radius: 50%;
}

In this pattern, the requested image size via PHP could be 96px (for better sharpness on high‑DPI screens), while the CSS constrains the displayed size to something that fits the design.

Performance Considerations When Increasing Gravatar Size

While it’s tempting to request very large avatars to keep them crisp on all devices, Gravatar images are external HTTP requests. Increasing the default Gravatar image size across hundreds of comments can affect page load performance.

Keep these guidelines in mind:

  • Balance size and quality: For most comment sections, 48–80px is plenty. For author bios, 96–128px is generally enough.
  • Leverage caching: Use a caching plugin and, if possible, a CDN to reduce repeated requests to Gravatar.
  • Test high‑comment posts: View a post with many comments using tools like Lighthouse or WebPageTest to gauge the impact of your new avatar size.

Making deliberate decisions about your default Gravatar size will keep your site visually polished without sacrificing speed.

Testing Your New Default Gravatar Size

After updating settings, templates, or functions, you should verify that the new default Gravatar image size works consistently across your site.

  • Clear caches: Purge any page caching and browser cache to ensure you’re seeing fresh output.
  • Check multiple templates: Inspect single posts, archives with author info, and any custom layouts that show avatars.
  • Test different user types: Log in with different accounts (admin, editor, subscriber) or use test comments with varied emails to confirm all display correctly.
  • Inspect image URLs: Right‑click and copy an avatar image address; you should see a parameter like s=64 or s=96 in the Gravatar URL matching your chosen size.

This quick audit ensures there aren’t any stray templates still using the old default size.

Common Issues and How to Fix Them

Sometimes, changing the default Gravatar image size doesn’t appear to work immediately. Here are a few common issues and solutions.

Avatars Still Appear at the Old Size

If the avatar markup looks correct but the visual size hasn’t changed, the culprit is usually CSS. Inspect the image with your browser’s developer tools:

  • Right‑click the avatar and choose “Inspect.”
  • Look for any width or height rules applied by your theme or plugins.
  • Override them in your child theme or via Additional CSS in the Customizer.

Avatars Look Blurry or Pixelated

This often happens when the displayed size is larger than the requested Gravatar size. For example, if you request a 48px image but scale it to 96px in CSS, you’ll lose crispness.

To fix this:

  • Increase the requested size in get_avatar() or wp_list_comments().
  • Ensure the requested size is at least as large as the largest expected display size.

Different Plugins Use Different Avatar Sizes

Some plugins call get_avatar() with hard‑coded sizes in their own code. If you want consistent Gravatar sizing everywhere, a filter‑based approach is often the best solution.

Use the get_avatar_data filter to normalize sizes:

function mysite_normalize_avatar_size( $args, $id_or_email ) {
    // Only override if the plugin has not set a custom size you want to keep.
    if ( empty( $args['size'] ) || 32 === (int) $args['size'] ) {
        $args['size'] = 72; // Your preferred default.
    }

    return $args;
}
add_filter( 'get_avatar_data', 'mysite_normalize_avatar_size', 10, 2 );

This approach standardizes the default Gravatar image size even when various plugins interact with avatars in different ways.

Best Practices for Choosing a Default Gravatar Image Size

When deciding on a new default Gravatar size, consider these practical guidelines:

  • Match your typography scale: For small comment text, 32–48px feels balanced. For large author names and bios, 64–128px is more fitting.
  • Be consistent across the site: Use a small size for comments and a larger one for author or team profiles, but keep each usage type consistent.
  • Account for retina and high‑DPI displays: Request a slightly larger avatar than the CSS size to maintain sharpness. For example, request 96px but display at 48px.
  • Test on mobile devices: Ensure that avatars don’t dominate limited screen real estate, especially in narrow comment layouts.

Conclusion

Controlling the default Gravatar image size in WordPress is a small tweak that can make a significant difference in your site’s visual polish and user experience. Whether you simply adjust a theme option, update template calls to get_avatar() and wp_list_comments(), or implement global filters and CSS refinements, you have full control over how avatars look and behave.

By thoughtfully choosing sizes that complement your layout, keeping performance in mind, and testing across different templates and devices, you can ensure that every Gravatar on your site feels intentional, professional, and aligned with your brand.

Michał Mikołaszek
Michał Mikołaszek

I’ve been leading Grafiduo since 2010 as the CEO. Together with my development team, I create e-commerce solutions, websites, and digital designs that combine functionality with aesthetics. I focus mainly on WordPress, WooCommerce, and Prestashop, helping businesses grow through well-crafted online experiences.