How to increase the upload size limit for cover images on BuddyPress

tehangat studio KjWWNbYnmEA unsplash scaled BuddyPress
This article can be read in about 2 minutes.

The steps to increase the upload limit are as follows.

You can increase the upload size limit by editing the functions.php file. For example, to increase it to 10MB, add the following code to your functions.php file:

function bbp_cover_image_file_size( $fileupload_maxk, $type ) {
    if ( 'avatar' == $type ) {
        $fileupload_maxk = 10485760; // 10MB in bytes
    }
    if ( 'cover_image' == $type ) {
        $fileupload_maxk = 10485760; // 10MB in bytes
    }
    return $fileupload_maxk;
}
add_filter( 'bp_attachments_get_max_upload_file_size', 'bbp_cover_image_file_size', 10, 2 );

This code increases the upload limit for both avatars and cover images to 10MB. It also works by pasting it in the WpCode Lite plugin and saving it.

Comment

Donate with Cryptocurrency!

Copied title and URL