When you buy a plan from your chosen web host to host your WordPress site, you may notice that the specifications mention the maximum file upload size.
Most of the time, we fail to notice it and it is only when you buy the package and start using it, you realize that there is something called maximum file upload size limit. You can find it from Media option on your Dashboard.
It is very important to know how to increase the maximum file upload size in WordPress. The reason is that most of the basic plan for WordPress has maximum file upload limit as 2MB.
You cannot upload images of very high quality because most of them would be more than 2MB. As a matter of fact, you cannot even upload most of the GIFs which are very popular these days. You have to compress the files, resize them and compromise with the quality. It is better not of talk about videos.
Now, it does not really make sense to buy a higher package from your web hosts just because of uploading a bigger file. Instead, you should know how to increase the maximum file upload size in WordPress irrespective of your web host plan.
There are multiple ways to increase the maximum file upload size in WordPress, and you may have to try all of them because some of them would work for some and others may not depending on your web host settings. You can do it by changing the theme function file, editing php.ini file, using .htaccess or even by plugins.
How To Increase The Maximum File Upload Size In WordPress Using Function.Php
This is to reiterate the fact that this method may or may not work for your WordPress site because of the internal settings by your web host. Therefore if it does not work, remove the code from the file where you paste them.
The same is applicable for all methods stated below.
Go to Appearance from the Dashboard and then from the drop down, click on the option Editor. In the new screen, find the file functions.php. Edit it and add the following lines at the end.
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
In case, it does not work, you can cut the code and paste it in wp-config.php file at the very end. If neither works, delete the code and restore the files in the original state.
How To Increase The Maximum File Upload Size In WordPress Using PHP.ini
PHP.ini is an important file which contains the configuration information of your server. You would need FTP of accessing and editing it.
Connect your FTP to your server, and in the root directory, you are likely to find it. Sometimes, it is kept hidden from view.
Therefore, you have to search with Show Hidden Files option. Sometimes, it could be named as PHP5.ini and so on. If you get it, search for the following lines of code.
If you spot them, you need to just modify the limits, and it will be done.
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
In case you do not get the file, you need to create one and add the following code it in.
If it does not work for your web host, change the limits to something like 10 MB, and it might just work.
How To Increase The Maximum File Upload Size In WordPress Using .htaccess
Again, .htaccess is an important file, and it should be tried only after the above two do not work. Remember, there could be a .htacess file in every web folder, but you have to choose the one at the root folder. If it is present there, edit it and paste the following lines. Paste them at the end of the file.
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
If it is not present which could be a possible case, you need to create one .htaccess file and just paste it.
How To Increase The Maximum File Upload Size In WordPress For Cloud Service Providers
If you are using cloud service for hosting purpose, you must be aware of the fact that most of the dedicated cloud service providers for WordPress provide an exclusive option to increase or decrease the file upload limit from time to time. Take for example, Cloudways who provide an interface to let you increase the limits as per your liking. It is these customized options that are making cloud hosting very popular.
How To Increase The Maximum File Upload Size In WordPress Using Plugins
As this is a core issue, you preference should always be to use code first. If they do not work, go for plugin method. Go to the Dashboard and to Plugins.
Click on Add New, and find the plugin Increase Max Upload FileSize.
It is quite a popular plugin and hence, reliable. Once you spot the plugin, click on Install button and then on Activate button.
After activation, it checks for the file upload size limit, and if it is less than 32 MB, it makes it 32 MB automatically. If you want more, you need to go to Tools from the Dashboard and click on the plugin name. You would find different options to modify and change the size as per your requirement.
But it is not a recommended method because the performance can slow down and the core files may get exposed.
When Nothing Works
If none of the above works for you, there is only one option left. You have to contact your web host support team and request them to increase it.
They could probably ask you to upgrade to a higher package, but you can put them in a risky position by telling them to increase the size in the same package or else you would migrate or not renew.
They value their customers, and even though the increase of limit may not be what you expect, they would surely double or triple the limit.
Well, you may always get what you want, but it depends on your communication skills and how much pressure you can put on them.
If you want it around the time of renewing your package, they will do it immediately.