Is there a way that I can remove/delete user profile picture through programing? or How can i override existing image with my new one?
use code below in hook_user_delete($account)
// Load user by using user id $user = user_load($uid); // Get file id of profile photo $fid = $user->picture->fid; // Load the file object $file = file_load($fid); // delete profile photo from. file_delete($file); // Unset the image object (my case it's 'picture') unset($user->picture); // Save the user user_save($user);