WP User Avatars

Plugin Banner

WP User Avatars

by John James Jacoby

Download
Description
  • Download and install using the built in WordPress plugin installer.
  • Activate in the “Plugins” area of your admin by clicking the “Activate” link.
  • No further setup or configuration is necessary.
  1. Your Profile (+1100px)

    Your Profile (+1100px)

  2. Your Profile (-1100px)

    Your Profile (-1100px)

  3. WP User Profiles (Side)

    WP User Profiles (Side)

  4. WP User Profiles (Normal)

    WP User Profiles (Normal)

Where can I find complete documentation?

The project wiki covers setup, the front-end editor, theme and plugin integration, multisite and remote storage, migration and compatibility, and capability-based customization.

How does this work with multisite?

It works OK, but you’ll want to consider exactly what level of privacy is best for your installation.

How do I add the avatar editor to a normal page?

Add the User Avatar Editor block or [wp_user_avatars] shortcode to an existing page. Both display the avatar editor for the signed-in user and do not create a profile page, registration flow, or membership system.

The block adds no heading or description by default. Add either inline in the editor when the surrounding page needs more context. The block also supports background, text, border, spacing, typography, and wide-alignment controls.

The shortcode uses the same avatar capabilities, upload restrictions, ratings, and Media Library permissions as the WordPress profile and bbPress profile integrations. Users without Media Library access can still upload their own avatar when the site’s avatar permissions allow it. Uploads can include a rating without JavaScript. Rating changes and removal also work without JavaScript when an avatar already exists. Choosing an existing Media Library image requires JavaScript.

Theme and plugin developers can render the same current-user editor with wp_user_avatars_get_editor().

The front-end editor uses semantic form groups instead of WordPress admin table markup. Themes can customize the wp-user-avatars-frontend-form classes. The block exposes --wp-user-avatars-card-* CSS custom properties on its wrapper. The block controls and shortcode expose --wp-user-avatars-button-* and --wp-user-avatars-primary-* properties on the block wrapper or an ancestor of the shortcode.

How do I set a default avatar for new users?

Choose a square Custom Default Avatar from the Media Library under Settings > Discussion. The selected image becomes an ordinary WordPress default for users who do not have an individual avatar. It is a site-level fallback and does not write avatar metadata to every user. Rectangular images are rejected to prevent distortion.

The setting is site-specific on multisite. Mystery Person and Blank remain available. Enable Block Gravatar when the selected fallback should be served directly without a Gravatar request.

How do I display a larger or sharper avatar?

WP User Avatars uses the image size requested by WordPress. Ask for the intended display size instead of enlarging the default 96-pixel image with CSS:

echo get_avatar( get_the_author_meta( 'ID' ), 256 );

When you only need the URL, pass the size explicitly:

$url = get_avatar_url( $user_id, array( 'size' => 256 ) );

WordPress requests a 2x source for get_avatar(), so the first example can also provide a sharper image on high-density displays when the uploaded source is large enough. Theme builders need to expose or pass the intended avatar size; CSS alone cannot recover detail from a 96-pixel URL.

How do I set alternative text for an avatar?

WordPress creates avatar image markup. Pass meaningful alternative text as the fourth argument to get_avatar() when the avatar conveys information:

echo get_avatar( $user_id, 96, '', 'Portrait of Jane Doe' );

WordPress escapes that value when it creates the HTML attribute. WP User Avatars supplies the image URL and preserves the caller’s alternative text. It does not copy alternative text from a Media Library attachment. A directly uploaded avatar may not have an attachment, and WordPress uses the same empty value when a caller omits alternative text or deliberately marks an avatar as decorative. Leave the fourth argument empty when nearby text already identifies the person and the avatar adds no information. Themes that build their own <img> markup must set the alt attribute themselves.

How do I limit generated avatar sizes?

WP User Avatars creates a square derivative the first time WordPress requests an uncached size for a directly uploaded avatar. To disable future plugin-owned dynamic resizing, add this to a site plugin, must-use plugin, or your theme’s functions.php file:

add_filter( 'wp_user_avatars_dynamic_resize', '__return_false' );

To allow only selected sizes, inspect the requested size with the same filter:

add_filter(
    'wp_user_avatars_dynamic_resize',
    function ( $resize, $user_id, $size ) {
        $allowed_sizes = array( 96, 192, 256, 512 );

        return $resize && in_array( (int) $size, $allowed_sizes, true );
    },
    10,
    3
);

For a directly uploaded avatar or a locally stored Media Library attachment, a disallowed uncached request falls back to the original full-size URL. A derivative that was already cached remains available. Disallowing a size does not delete existing files or change stored avatar data. Remotely stored Media Library attachments continue to use WordPress image-size resolution.

Where can I get support?

  • Community: https://wordpress.org/support/plugin/wp-user-avatars
  • Development: https://github.com/stuttter/wp-user-avatars/discussions

Replaces Gravatar

By Dennis Bareis (dbareis) on December 16, 2023

Very simplistic (which to some people is good) but not only do I want one that supplements Gravatar but has user support, this one is abandoned.

Does not replace WP User Avatar

By ctmartin2020 on April 20, 2022

A lot of people seem to think this replaces the former WP User Avatar… it does not. First, it appears that support is seriously lacking here… look at the numerous support questions left unanswered. A couple that particularly interested me had to do with whether it was possible to allow users to upload their avatar from the frontend. I do not give users access to the WordPress Admin User page. The old WP User Avatar had a nice simple shortcode which I could use on the frontend. I find there is ZERO documentation here for this plugin and even looking through the code I can find NO shortcode for use on the frontend… so even though those support questions went unanswered, I can see why: there is NO support for user avatar uploads on the frontend. So the bottom line is, if you’re looking for something that provides an interface for users on the frontend (like the old WP User Avatar), this plugin will NOT do what you need. One User Avatar does.

Nice and simple

By mikejcandy on August 25, 2021

Nice and simple plugin. Great replacement for the corrupt ProfilePress (previously WP User Avatar).

Refugee Seeking replacement

By sxn31 on June 12, 2021

As other reviewers are commenting, I’m here after being tricked by the authors of a different avatar plugin. This is doing the job nicely.

Excellent replacement for rival plugin

By Lars (thelogbookwebsite) on May 31, 2021

I was using rival plugin WP User Avatar (no “s”) that just suddenly transformed into this ‘ProfilePress’ membership plugin adding a bunch of stuff I didn’t need, want or asked for. WP User Avatars (this plugin, with an “s”) is light weight, functional and does what it says it will do. Please keep it this way…

Great Replacement for WP User Avatar

By Le Isaac (marg3) on May 30, 2021

Glad I found this lightweight replacement for WP User Avatar (no “s”). That plugin was recently changed extensively and rebranded as ProfilePress. I didn’t want or need all the stuff they added and am so happy that I found WP User Avatars (with an “s”). It’s such a good replacement and it does just what I need, which is to allow me to create custom avatars for my users and authors. Great work!

Light & stable – keep up the good work!

By boogieboa on May 19, 2021

@johnjamesjacoby, I really hope you will continue to maintain and update “WP User Avatars” now that its main rival has turned into the unwanted and bloated “ProfilePress” – 40,000 new users need you.

Superb, works with Elementor author box

By laymonk on March 9, 2021

I use UM, and users know how to upload their pix to their profile, but then their articles they author is unable to show their profile pix (in author boxes) because WP and plugins that offer author boxes only look in gravatar for image sources. Another similarly named plugin (with 400k downloads) is unable to do what this plugin does so straight-forwardly. I am loving JJJ plugins, and learning from them. Reminder to self, ensure you make a donation to this awesome contributor

Best user avatar or pofile picture plugin

By Knut Sparhell (knutsp) on November 12, 2020

Integrates well with WP User Profiles plugin from same author.

Very Good

By y.ryslan on October 6, 2020

Very good plugin

2.2.0

  • Add a site-specific custom default avatar from the Media Library.
  • Publish setup, integration, multisite, migration, and customization guides in the project wiki.

2.1.0

  • Add a User Avatar Editor block and [wp_user_avatars] shortcode for normal pages.
  • Keep local avatars ahead of avatar providers that return early, including when their URLs match.
  • Preserve the primary profile save action when avatar controls are present.
  • Explain avatar display sizes and generated-size limits.
  • Document avatar alternative-text behavior for themes and plugins.

See CHANGELOG.md for earlier releases.