How to Increase the Maximum Upload File Size Limit in WordPress: Fix upload_max_filesize Error
WordPress is a PHP-based content management system. So, it needs PHP enabled web server to run. PHP settings also affect the performance of WordPress on different web hosts. File upload size limit is also one of the features that depend on the web hosting configuration. Each web hosting provider has a maximum upload size limit for their servers. If the file you are trying to upload exceeds that limit, the script throws the upload_max_filesize Error.
In WordPress, you can upload media files and attach them to your post. But there is a limit to the maximum upload size. This depends on the upload limit added by your web host. Few hosts only allow as low as 1 MB file size. This size is sufficient if your blog does not need high-quality images or videos. But what if you want to increase the file upload size limit? In this post, we are adding a few ways of increasing the max upload file size limit in WordPress.
Best Managed WordPress HostingWPEngine is the best and most secure managed hosting provider
These methods may not work for a few web hosts. If you are unable to resolve the problem after following all the given ways, you will have to contact your web hosting provider. Good web hosts like BlueHost will provide good customer support.
Ways to Fix upload_max_filesize Error WordPress
Here are some ways to fix the upload_max_filesiz error in WordPress and increase the maximum file upload size in WordPress. You need to try these methods one by one and see if the method worked. There is no need to try all.
1. Functions.php Method
Use the three lines given below and add them at the top of the functions.php file. And then try uploading large files to your WordPress blog.
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
To get access to functions.php, you can either use FileZilla or cPanel’s File manager. The file can be found inside the theme’s folder found inside wp-content/themes.
2. Editing the wp-config.php File
Another good way to fix the upload_max_filesize error is by tweaking the wp-config.php located on the root directory of your WordPress website. You just need to edit the wp_config.php file and add the following line before the “That’s all, stop editing! Happy publishing” line.
@ini_set('upload_max_size' , '256M' );
Now save the file and refresh the browse. Try to upload the file again.
3. Htaccess method
You can also try the htaccess method. You only need to add the given lines in the .htaccess file. It can be found in the root directory. Be sure to take the backup of this file before doing any changes. If you are unable to find this file in the root directory, show hidden files.
Add these lines
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
4. Update php.ini to Fix the upload_max_filesize Error
If you are using VPS, then you can try editing the php.ini to resolve the upload_max_filesize Error. This method may also work on a few shared web hosting providers but not all shared hosting let users update php.ini settings.
In your cPanel dashboard, look for the “MultiPHP INI Editor” option. Clicking on this asks me to select the location. It is because I have multiple domains installed and I need to select the domain for which I want to update the php.ini file. After selecting the domain, it shows the options I can change in php.ini. It shows the option to change upload_max_filesize.
In my server, the limit is set to 64MB. You can change this value in your server to have any comfortable value meeting your needs.
5. Plugin way
If you think that you are not brave enough to modify files, you can try the plugin way. Install Max Upload Size plugin and it will increase the file size upload limit to the value you enter.
This plugin is really easy to use. Just install and activate the plugin on your WordPress website. It will also add a settings panel where you can enter the value you want to set for upload_max_filesize.
Try these methods and see what worked for you. Try these ways in the given order. If all these methods are not working, it means your web host has disabled all the ways to increase the file upload size limit of your hosting account. So, you need to contact your hosting support team to fix the upload_max_filesize Error.