How to Increase the Maximum Upload Size

In general this is not a WordPress issue, but a server side’s setting. Hosting providers put a limit on a maximum upload size due to security and efficiency reasons. The limit is fair solution for server’s resource allocation problem; However, nowadays the default limit of 2 MB or 5MB is often to low.

To check your maximum upload size limit:

  1. Navigate via WordPress Dashboard to Media » Add New;
  2. You can see the max limit size at the bottom of the page (e.g. Maximum upload file size: 32 MB.)

Following error will occur, in case the media file you try to upload exceed the restricted limit:

The uploaded file exceeds the upload_max_filesize directive in php.ini.

The best solution is to ask hosting providers to increase the limit, particularly if you are using a shared host. However, you may try to fix the error by:

Using php.ini file

php.ini file is located in the root directory. In case there is no php.ini file, just create one and add code below:

upload_max_filesize = 64M 
post_max_size = 64M
max_execution_time = 300

Using function.php file

Alternatively, you may add following code to yours child theme functions.php file:

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

Using htaccess:

Open or create the .htaccess file in the root folder 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
Was this article helpful?
0 out of 0 found this helpful

We're always happy to help with any questions you might have!
Ask the Community or open a support ticket and our team will reply with a solution.