Increase the WordPress Maximum File Upload Size

There are 3 ways for you to increase the maximum upload file size for your WordPress site.

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) which you will be able to view when trying to upload files to your Media Uploader in WordPress.

In most cases (that we’ve experienced) 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.

media_upload_limit

 

There are 3 limits you want to increase when doing this as these will increase the allowed size of the files that are allowed to be uploaded, an sets 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) Theme Functions File

If the host allows, 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.

 

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 (apparently, 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

Again, depending on your host, you can also try increasing the limit by editing your .htaccess file in the root folder on your server.

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 host, these methods might not work for you.

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