How to increase maximum upload file size in WordPress

When uploading media files, you may not be able to upload media files due to file upload size limitations. The upload size limit is displayed on the Media File Upload screen.

 

Maximum upload file size

 

In the picture above, the maximum upload file size is set to 80 MB. A media files rarely exceed 80 MB in size, so it doesn’t seem to be a problem normally. How you change this size may vary slightly depending on your hosting environment. If you need to change the maximum upload file size due to a file upload error, please try the following method to change the setting.

 

Editing the PHP.INI file to increase maximum upload file size

If you have access to your php.ini file, add the following code to your php.ini file.

If you are using a shared host, please create a php.ini file in your root folder and add the above code to make sure it works.

If you install a program such as Xampp on your PC to run WordPress, the location of the php.ini file is as follows (Most of them are from the Internet, so they may be inaccurate. If inaccurate, please let us know in the comments below and we will correct it).

php ini

 

Editing the .HTACCESS File to increase maximum upload file size

Try adding the following line to the end of the .htaccess 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

Adding the above code may throw an error depending on your hosting server. If you get an error when using this method on Bluehost, please refer to the instructions in the Changing memory_limit and max_execution_time settings on Bluehost section of this article.

The picture above shows the system information from the WordPress site using  A2 hosting. In the case of A2, the size of upload_max_filesize is set to 2MB.  If you want to change the file upload size, please add the above code to your .htaccess file and test it. If the problem is still not resolved, please contact A2 HOST.

Add to theme function file to increase maximum upload file size

Add the following code to your theme function file.

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

Surprisingly, this method can easily change the file upload size.

If the server itself imposes a file upload size limit, you will need to contact your hosting company to resolve the issue. If you are using Bluehost VPS or Dedicated plan, please refer to “Changing wp_memory_limit and max_execution_time settings”.

 

Addition: If you receive the any error message, please refer to the above to increase the memory size.

Leave a Reply

Your email address will not be published.