If you work with WordPress CMS, there’s a pretty fair chance you come across some very common errors. Maximum File Upload Size error is one of them. It occurs whenever you try to upload any file through WordPress admin panel. The Maximum File Upload Size Limit is a server side error which prevents you from uploading a file due to its size. The default size limit value is set by your hosting provider. Sometimes, it is as low as 2MB which is not enough for audio and video files. In order to solve this error, you need to increase maximum file upload size limit in WordPress and optimize your server configuration settings.
Ways to Increase Maximum File Upload Size Limit in WordPress
Let’s have a look at different ways in which you can increase maximum file upload size limit in WordPress.
1. Theme Functions File (functions.php)
If you want to increase maximum file upload size limit in WordPress through theme functions file, add the following line of code in functions.php file:
@ini_set( 'upload_max_size' , '96M' );
@insi_set( 'post_max_size', '96M');
@ini_set( 'max_execution_time', '300' );
2. Editing .htaccess File
You can also increase maximum file upload size limit in WordPress by editing the .htacess file located in your root directory. In order to do that, add the following lines of code in your site’s .htaccess file:
php_value upload_max_filesize 96M
php_value post_max_size 96M
php_value max_execution_time 300
php_value max_input_time 300
3. Create or Edit php.ini File
If you’re using a shared hosting plan, chances are you don’t have access to php.ini file. If you do have access, you can edit the existing php.ini file to increase maximum file upload size limit in WordPress but If you don’t, you can create a new php.ini file, add the following lines of code and upload it to your root directory:
upload_max_filesize = 96M
post_max_size = 96M
max_execution_time = 300
Please note that these techniques may not work on a shared hosting plan so in that case, it’s always a good idea to get back to your web hosting provider and they can assist you in a better way. If you need help in deciding a web hosting company, check out my guide on 3 best web hosting providers.
I hope after reading this article, you’ll be able to learn how to increase maximum file upload size limit in WordPress. If you’ve any questions, feel free to ask in the comment box and I’d be more than happy to assist. If you liked this article, please subscribe to our YouTube Channel. You can also follow us on Facebook, Twitter and Pinterest.