Introduction
By default, BuddyBoss limits the uploading of profile avatars and cover images to 5MB. You can increase this limit by adding a small custom function to your active theme. This guide explains how you can change the upload limit of profile and cover images.
Custom Workaround
- Go to Appearance > Theme Editor in your WordPress admin dashboard.
- Under Select theme to edit, choose your active theme (preferably a BuddyBoss Child Theme) and click Select.
- From the Theme Files list, open Theme Functions (functions.php).
- Add the following code just before the closing PHP tag ?>:
/* Adjust PROFILE COVER upload limit */
function bbp_cover_image_max_upload_file_size( $fileupload_maxk, $type ) {
if ( 'cover_image' == $type ) {
$fileupload_maxk = 10485760; // in bytes, 10MB
}
return $fileupload_maxk;
}
add_filter( 'bp_attachments_get_max_upload_file_size', 'bbp_cover_image_max_upload_file_size', 10, 2 );
/* Adjust PROFILE AVATAR upload limit */
add_filter( 'bp_core_avatar_original_max_filesize', function() {
return 10485760; // in bytes, 10MB
} );- Click Update File to save the changes.
Troubleshooting and FAQs
Q: I still get an error uploading large images.
A: Check your server’s PHP settings (upload_max_filesize and post_max_size) as they may also limit the file size. This code only modifies the BuddyBoss-specific limits.
Q: Can I set different limits for avatars and cover images?
A: Yes. Modify the numbers in each respective filter function to set different values for avatars and cover images.
Q: Will this affect other media uploads?
A: No. This change only applies to BuddyBoss profile avatars and cover images.
Q: Can I revert this change easily?
A: Yes. Remove or comment out the added code from functions.php and save the fil