The wp-avatar-filter
plugin for WordPress enables automatic user avatar assignment based on uploaded images. By simply uploading a file named username.jpg
, the plugin dynamically sets it as the avatar for that user, eliminating the need for manual avatar selection.
This is particularly useful for bulk user creation, allowing administrators to quickly assign profile pictures via the WordPress media library.
- Automatically assigns user avatars by matching images to usernames (e.g.,
johnsmith.jpg
for userjohnsmith
). - No manual avatar selection required—just upload the correctly named image.
- Works dynamically: updating an avatar is as simple as deleting an old image and uploading a new one.
- Tested with over 200 users for bulk assignment.
- Download the
.zip
file. - Edit the
.php
file inside the plugin folder and replaceexample.com
with your own WordPress site URL. - Re-compress the edited plugin folder into a
.zip
file. - Upload the
.zip
file via the WordPress admin panel (Plugins
>Add New
>Upload Plugin
). - Activate the
wp-avatar-filter
plugin. - Ensure that in
WordPress Settings
>Media
, the option "Organize my uploads into month- and year-based folders" is unchecked to allow direct access to uploaded images.
- Upload an image named after the username (e.g.,
johnsmith.jpg
) to the WordPress media library. - The plugin automatically applies the corresponding image as the user's avatar.
- To change an avatar, simply delete the old image and upload a new one with the same naming format.
- This plugin uses the
get_avatar_data
filter hook to override default avatars dynamically. - WordPress API documentation on this hook can be unclear, but thanks to Adi Kusuma on Stack Overflow for guidance: Adi Kusuma's profile.
This plugin is licensed under the GPL 2.0 or later.
With this plugin, bulk user avatar assignment becomes seamless, reducing manual work and ensuring a consistent look across your WordPress user profiles.