WordPress provides a filter upload_size_limit to set the limit of maximum upload size.
A simple way to set maximum upload size for frondend as well as admin dashbaord just add following code to the end of file functions.php in active wordpress theme.
function filter_site_upload_size_limit( $size ) {
// Set the upload size limit to 20 MB for users lacking the ‘manage_options’ capability.
$size = 1024 *1024*20;
return $size;
}
add_filter( ‘upload_size_limit’, ‘filter_site_upload_size_limit’, 20 );
In case you need to increase file upload size for admin side only use following code:
function filter_site_upload_size_limit( $size ) {
// Set the upload size limit to 20 MB for users lacking the ‘manage_options’ capability.
$size = 1024 *1024*20;
return $size;
}
function set_max_file_upload_size_for_admin()
{
add_filter( ‘upload_size_limit’, ‘filter_site_upload_size_limit’, 20 );
}
add_action(“admin_init”, “set_max_file_upload_size_for_admin”);