Increase the File Upload Size

There are 3 ways you can increase the maximum upload file size for your WordPress website.

Usually the host will not let you increase this yourself, but it can be increased simply by contacting your host and asking them to increase the limit for you.

Depending on your web host and the package you’ve chosen, there will be a maximum upload file size set (originally set to around 8mb in WordPress) which you will be able to view when trying to upload files to your Media Uploader in WordPress.

 

 

There are 3 limits that you want to increase when doing this. These will increase the allowed size of the files that are allowed to be uploaded, set the maximum time in seconds a script is allowed to run before it is terminated (max_execution_time).

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

 

1) Edit the Theme Functions File

If the host allows this, you could simply increase the file upload size and max execution time by adding the following code into your functions.php file

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M' );
@ini_set( 'max_execution_time', '300' );

To see if the changes have taken effect go back to your Media upload page and refresh the page, if not, then it will be the same amount as before.

 

2) Create or Edit an existing PHP.INI file

Generally if you are on a shared host you will not see a php.ini file in your root directory, but if you do then you can search for each of the following lines within the file and then change the values to what you need.

upload_max_filesize
post_max_size
max_execution_time

If you do not see a php.ini file in your root folder then you can (I haven’t done this before) create one and add the following lines of code to increase your limits.

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

On some servers these changes will take effect immediately while on other servers it can take longer because the server might be caching the files. If the changes do not work after a little while you can also try renaming the file to php5.ini

To see if the changes have taken effect go back to your Media upload page and refresh the page.

 

3) htaccess Method

Open the .htaccess file and add the following code:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

 

Again, I will emphasize that if you are on shared hosting or depending on your hosting provider, these methods might not work for you as usually the host does not allow this to easily be edited.

In that case we recommend contacting your host to increase these limits, which could save you a lot of time.