Skip to content

Local User Avatar

Local User Avatar lets people upload a profile photo that lives in your Media Library instead of depending on Gravatar. Once set, that local image is used wherever WordPress shows an avatar for that user.

When the module is enabled:

  • Adds a Local avatar upload control on Users -> Profile and Users -> Edit User.
  • Stores the chosen Media Library attachment ID in user meta (powersuite_avatar).
  • Overrides get_avatar_data and get_avatar_url so themes, comments, and the admin use the local image.
  • Falls back to Gravatar (or your site’s normal default) when no local avatar is set.
  • Wins over a Google Sign-in profile photo when both exist.

The core WordPress “Profile Picture” row is hidden so the local upload UI is the clear place to manage the photo.

  • You want avatars hosted on your site for privacy, branding, or faster loads.
  • Members or staff should set their own photo without a Gravatar account.
  • You use Google Sign-in and still want an uploaded photo to take priority.
  1. In WordPress admin, go to WP PowerSuite -> Modules.
  2. Filter by Login & Users or search for “Local User Avatar”.
  3. Turn the module’s toggle on.

There are no module settings. To undo it, toggle the module off. Existing powersuite_avatar meta remains until removed from a profile; with the module off, WordPress stops using those overrides.

  1. Open Users -> Profile (or edit another user).
  2. Under Profile Picture -> Local avatar, click Upload Avatar, pick an image, and save the profile.
  3. Check a comment, author box, or admin list that shows avatars. ✅ Working: you see the uploaded image (often with an avatar-local class).
  4. ❌ Not working: Gravatar/default still shows - confirm the module is on and the attachment is a valid image.
  5. Click Remove, save, and confirm Gravatar/default returns.
  • Upload button does nothing. Confirm you’re on profile.php / user-edit.php and that the Media Library works for your role.
  • Avatar doesn’t change on the front end. Clear any page/object cache; confirm the theme uses get_avatar() / get_avatar_url().
  • Non-admin can’t use someone else’s attachment. Users without manage_options may only assign attachments they own.
  • Deleted media leaves a broken avatar. Deleting the attachment clears the matching user meta automatically.
Does Local User Avatar replace Gravatar completely?

Only for users who upload a local photo. Users without a local avatar still fall back to Gravatar (or your site's default avatar behavior).

Where is the avatar stored?

As a Media Library attachment. The attachment ID is saved in user meta under powersuite_avatar.

Does a local avatar override a Google Sign-in photo?

Yes. If a user has a local upload, that image wins over a stored Google profile photo.

Are there module settings?

No. Enable the module, then each user (or an admin editing their profile) uploads a photo on the profile screen.

Developer notes (hooks & filters)

Source: modules/local-user-avatar/module.php. Boots on the display tier. Context: both (admin + front end).

  • User meta key: powersuite_avatar (attachment ID).
  • Filters: get_avatar_data and get_avatar_url at priority 15.
  • Profile UI: show_user_profile / edit_user_profile (render), personal_options_update / edit_user_profile_update (save).
  • delete_attachment removes matching usermeta rows.
  • Transient wpps_local_user_avatar_any caches whether any local avatar exists (avoids usermeta scans when none are set).
  • Adds CSS class avatar-local on overridden avatar data.

Avatar precedence with other WP PowerSuite modules (documented in Google Sign-in’s avatar helper): local upload -> Google stored URL -> Alphabet Avatars / Gravatar defaults.