Simple Local Avatars

Add an avatar upload field to user profiles. Generate requested sizes on demand, just like Gravatar.

Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight.

Just edit a user profile, and scroll down to the new “Avatar” field. The plug-in will take care of cropping and sizing!

  1. Stores avatars in the “uploads” folder where all of your other media is kept.
  2. Has a simple, native interface.
  3. Fully supports Gravatar and default avatars if no local avatar is set for the user – but also allows you turn off Gravatar.
  4. Generates the requested avatar size on demand (and stores the new size for efficiency), so it looks great, just like Gravatar!
  5. Lets you decide whether lower privilege users (subscribers, contributors) can upload their own avatar.
  6. Enables rating of local avatars, just like Gravatar.

Avatar upload field on a user profile page

  • Rating
  • Requires 6.5+
  • Downloads 1,986,699
  • Updated 2024-11-18
  1. How do I call this in the comments template?

  2. Please I need to be compatible with BuddyPress

    • It’s on the roadmap!

    • I dont understand

    • “On the roadmap” means that it will come soon! :-) (Hopefully, I’m itching for it too.)

  3. The plug-in works great, apart from one minor little hitch: the default size for avatars on my site is 80×80 pixels which I have all re-sized successfully. The only little hiccup is on the user’s profile page itself where the default avatar size is 96×96 pixels. I’ve found the 2 places in the code where it reads ’96’ and changed them to ’80’ however the profile page avatar remains at 96. What am I missing here? Thanks.

    • The plugin will automatically resize the avatars to any size that’s smaller than the original upload.

  4. Hi,

    THanx for so simple and great plugin. I´m having a problem with the functions who calls the avatar image since last wp update to 3.3. I get this message:
    Notice: get_user_by_email is deprecated since version 3.3! Use get_user_by(’email’) instead

    and to get the avatar I´m using this code:

    The avatar prints on the front end but also have this message above the avatar :P

    Any idea of how to fix it?

    Much thanx! :)

    • Sounds like you have debug mode on in your wp config file. Either way, I’ll release an update shortly!

  5. Hi,
    I would like to use an avatar from the user’s profile (Simple Local Avatars) in comments instead Gravatar. How can I do it? Thanks)

    • If the comment is associated with a registered user in WordPress, it will use the local avatar. This plugin does not offer custom avatars to generic commenters.

  6. Hi!
    I fixed the plugin like Pancho said, thanks for that.
    But: Your code to get the avatar was killed by the validator. Damn.
    Could you repeat it? Must be something like get_avatar(), but I’m new to the plugin dev stuff.
    My goal: Show the author-avatar of each post next to the post and in the full view of it. get_avatar(the_author_meta(‘ID’)) in content-single.php may be correct. Do I have to include something there?

    By the way: Thank you for this plugin !!

  7. Can you explain how do I support BuddyPress?

  8. Can you implement a default local avatar? I will remove all requests to gravatar.com

    • I’ll leave alternative default avatars to a different plugin intended to do that. FYI, if you Google around a bit, there are tutorials for changing that with code.

  9. Hi,
    Just updated the plugin and whilst it’s showing the updated image in the user profile, it’s not updated in the admin bar, either in the 16×16 icon or the larger image that appears on hover. I’ve force-refreshed the browser and logged in/out several times, so I pretty sure it’s not the browser cache. I’m using WP3.3 and your version 1.3.1.
    Many thanks,
    Emma

    • Interesting. Will investigate.

  10. Code is good. However, there seems to have two bugs. Since the plugin use name_avatar format to store image, when updating those already have local avatar’s users, the admin panel will show the old one. Second, the plugin seems to use (I have not looked through the code) the appeared name of user as prefix, so when using Unicode name and saving the image, the file name messed up.

    • (1) The plugin deletes any pre-existing avatars before applying the new one, and has code to use a different file name if it’s already taken by some other media file.

      (2) I’ll investigate.

  11. Hi,

    I am wondering what plugins work with your plugin to allow uploading of avatars from the front end. I am currently using the plugin ‘Front End Users’ and no avatar info is showing up with your plugin installed.

    Thanks,

    Nick

  12. Is there a way to limit the file size of the image uploaded? It’s because I could upload a 2,3Mb file size as avatar. The image was resized but the orininal file (with 2,3Mb) is still on the uploads folder.

    • Currently, it respects WordPress’s media upload limit.

  13. Works just like you say :) Not a prob here and im not well versed in WordPress …takes some time to get what ya want in wordpress but hey nothing in life is easy :), Would like to see a plugin that will actually put the avi on the page along with the Authors name, id like to see 1 thats easy …not having to put php code in :)

  14. i have your avatar and love it. however, i had a fatal error the other day and my host looked and found it was this plug in. do you have any idea what it is, i would love to put it back

    • I added a cache, and thought to activate this plugin again. the same fatal error shows. I deactivated again and unless you know why this is happening, i will have to look for another avatar plug in

    • Can you tell me more the error… ? Hard to know with this information.

  15. Great plugin. Can we put uloaded avatar in single folder, ex. /uploads/avatar? Because we have new users sign up and their avatar spread around.
    Thanks.

    • I’ll think about this, since several have asked. Personally, I think it makes sense to put them with other media, but I haven’t ruled this out.

  16. Hi,

    your plugin is great!
    But one big problem for me, preventing me from using it: You keep the originally uploaded file no matter what size it is. I want all users to upload avatars, so this could really crowd my webspace with 2MB (or even lager) pictures …

    Would you include a filesize limit on upload in your plugin? Would be great !! I think 500KB would be sufficient.

    Thx!

    • I need to think about this, since it’s rather arbitrary and I don’t want to add an option for it. Maybe I’ll add a filter for it so devs can control it with their themes.

  17. I dunno if I am just really stoopid or what… why I just do not understand what I need to change in the coding to change the SIZE of the AVATAR as it appears beside any given post. I have changed the “96” I have tried the get_avatar function with my size changes (ie. $size=’150′) not actually doing anything … I am not the smartest when it comes to PHP but just exactly where do I make the image size changes to change the Avatar SIZE?

    Thank you for your time and I apologize ahead of time in the event I just “Missed The Boat” :)

    • The second argument in the get_avatar function is the desired size. However, keep in mind this will only scale *down*, not up. And if your server doesn’t support image management (GD) it won’t work (nor would you be able to have resized versions of any images in WordPress.

  18. Thanks for making such a useful plugin. I just have one question — using your plugin, is it possible for folks who simply comment on a post can upload an avatar to accompany their comment? Or is it only for users who are registered at some level of the author-contributor hierarchy?

    • It’s only for registered users, although they can be as simple as “subscriber” level users.

  19. Jake, please tell me a code for show all the avatar form with upload avatar function in my personal user profile page in front end for my wordpress multiauthor site.

    I read all online about it but there are only confusion and mistakes, thanks a lot.

    Please answer me!

    • I don’t wont other plugin like theme my login etc. But i need only a little code function for recall the upload form from my user profile page on front end..

    • There’s no simple answer I can provide here – it depends how you roll your solution. But the plugin works by hooking into user profile fields to add the field and the save user to handle the upload.

  20. First off, you have the only plugin that works now that I’ve put my secondary instalation of wordpress as a sub-domain. One question though. I’d like to move the avatar section of the user’s profile to the top of the profile page. Can’t seem to figure out how to do this. I should also mention, I’m using another plugin called theme my log in. Any advice would be great. Thanks

    • The only way to move it in the profile page is with JavaScript after the document is ready. The profile screen hooks only allow you to add new fields at the bottom.

Leave a Comment

Finely crafted websites & tools that make the web better.