Im seeing in my wp-content/uploads/avatars folder that there are tons of avatars from when I created test users, but changed the avatars. So, i’m assuming that even if the user changes their avatar, the old file remains? That seems like a build up of unnecessary img files. Is there a way to discard the unused avatars, and only keep the users current full and thumb width image? Other than manually deleting them. It would be very troublesome trying to decipher which is being used in an live environment

Ive googled doing a cron job, but I'm not too familiar with the way it works. Any ideas?


What version of BP are you using?

Changing your avatar should result in the uploaded file being deleted after the creation of the thumb and full versions. And those versions should over-write the old versions.

Avatars don't have a db entry, so what file names are you seeing in an avatar folder? You should only see one set of ...-bpthumb and ...-bpfull files.

If you're seeing all the source files, perhaps there is a permissions issue re deletion? Any warnings in your error log?

  • Hi sam, I'm using the latest version, and when I check my uploads folder, I see avatars i uploaded but never cropped and saved. I'm working locally on mamp, not live. But I get no errors when I check my php log...I wonder. Any ideas on what it could be? – Sin Jul 11 '12 at 8:48
  • 'latest version' - it helps to be specific, not that it matters in this case. 'never cropped and saved' - then you never finished the process so the uploaded file won't be deleted. You could write a script to look thru all avatar dirs and delete all file that aren't bpthumb or bpfull. Or you'll have to manually delete them. – shanebp Jul 12 '12 at 13:25
  • That sounds good, a script that will go through and delete those files. Cause I just know users will get half way through the process, change their minds, and want to upload a different avatar. So, in that case, it would be wise to go that route. I was thinking that maybe i'd build a button that says "cancel" and then that button could trigger the event you suggested. I'll have to do some research as far as the scripting goes, or ask some questions. Im not the best when it comes to building scripts from scratch such as that. Thanks again! – Sin Jul 14 '12 at 0:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.