Looking to increase your maximum file upload size in WordPress? Low file upload limits can cause a your file name exceeds the maximum upload size for this site error and stop you from uploading files in your media library or from installing large-sized plugins and themes.
In this article, we’ll show you how to increase the maximum file upload size on your WordPress site.
Checking Your Maximum File Upload Size Limit in WordPress
If you’re facing an issue due to the maximum file upload limit, you’ll need to check the file upload limit for your site first. You can check it easily from your WordPress dashboard.
To do so, you’ll need to go to the Media » Add New page from your WordPress dashboard. Then, you’ll see the maximum file upload size limit for your WordPress site.
Let’s go ahead and check how to increase the maximum file upload size to fix the issues. We’ll start with quick fix options first.
Note: The first 3 methods are meant for quick fixing the issues caused by maximum file upload size limits. However, they may not work with some shared hosts. In that case, you’ll need to go for the fourth option, i.e. contacting your hosting provider.
1. Edit Your Theme Functions File
The first way to increase the maximum file upload size limit is to edit your theme’s functions.php file.
To do that, you’ll need to go to Appearance » Editor from your dashboard. Then, go to the functions.php link on the right-hand side’s panel and click it. As the file opens, scroll down to the bottom of the page and create a new line. Next, you’ll need to copy the code below and paste it there. After you do that, don’t forget to update the file.
@ini_set( 'upload_max_size' , '256M' );
@ini_set( 'post_max_size', '256M');
@ini_set( 'max_execution_time', '400' );
Once you do that, you can go ahead and check if it worked on your site. If it didn’t, you can try the other methods below.
2. Create or Edit an Existing PHP.INI File
For this method, you’ll need to access your WordPress site’s root folder by using an FTP or File Manager app in your hosting account’s cPanel dashboard.
Then, you’ll need to look for the php.ini file in your root folder. If you can’t find it, you’ll need to create a file called php.ini and upload it in the root folder. In most cases, if you’re on a shared host, you won’t see it.
Then, open the php.ini file and add the following code to it:
upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 400
The file size defined above in the example can be adjusted as per your needs.
3. Edit .htaccess file
To increase the maximum file upload size limit by this method, you’ll need to access the root folder of your site as in method 2.
Open your site’s root folder and find the .htaccess file in it. Then, open the file to edit it, and add the following code:
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value max_execution_time 400
php_value max_input_time 400
That’s it. You can go to media uploading option again and check if worked. If it didn’t work out, you’ll need to contact your hosting provider as suggested in the next method.
4. Ask Your Hosting Provider to Increase the Maximum File Upload Size
If the above solutions didn’t work for you, you’ll need to contact your hosting provider for the ultimate solution.
Your WordPress file upload limit is basically related to the resources your hosting provider allocated for your site. Hosting services sometimes limit the file upload size for your own good. For example; by limiting the file upload size, you can prevent your users from uploading large files, videos, etc.
But, sometimes, it can restrict you from uploading useful files on your site and installing WordPress plugins. When such an issue occurs, you can try one of the above methods or ask your hosting provider to increase the maximum file upload size for your site.
For example, we use Bluehost for some of our projects and they’re quick at solving issues like this.
Bluehost offers a special discount for IsItWP users. You can get WordPress hosting for just $2.75 per month. You also get a free domain name as well.
If you’d like to learn more, here’s our complete Bluehost review.