WooCommerce: “uploaded file exceeds the upload_max_filesize” Error

upload-max-file-size wordpress

You may have seen this error at least once, if you have used WordPress. When installing a theme, plugin or uploading a image or file, you may find this dreaded message on your screen.

Well, it has nothing to do with themes or plugins. The issue is with your server settings which limit the maximum size for uploaded files.

It’s a common error and it can be easily fixed. This error message is an indication of that the file you are trying to upload is larger than your web host allows (WordPress default file upload size is 2 MB).

Solution is easy, you need to increase your file size upload limit. You can do it yourself or ask your web host support team to increase is for you.

Ways you can fix it:

  1. Updating Your php.ini file
  2. Editing Your .htaccess file
  3. Editing your wp-config.php File
  4. Contacting your Web Hosting Support

Updating Your php.ini file

Each server has a php.ini file, typically can be found in wp-admin folder. You need to edit open that file and write your new memory limit.

Follow these steps to edit the php.ini file

  1. Log in to your web hosting account and go to cPanel
  2. Click on FILES -> File Manager
  3. Select “Document Root for:” from the Directory Selection and click on Go. (Make sure the checkbox for Show Hidden Files is checked)
  4. Go to your wp-admin folder
  5. Find a file called php.ini or php5.ini. (If you don’t see any php.ini, create a file titled php.ini)
  6. Open the php.ini file. Find these lines in the php.ini file and replace it with the content below
  7. Save the changes you made to the php.ini file
  8. Now refresh your website and try uploading the file again.
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

Above settings may vary based on what web hosting company you are using.

Editing Your .htaccess file

If the above editing PHP.ini file doesn’t work for you, then you can edit your .htaccess file to fix this issue.

Follow these steps to edit your .htaccess file:

  1. Log in to your web hosting account and go to cPanel
  2. Click on FILES -> File Manager
  3. Select “Document Root for:” from the Directory Selection and click on Go. (Make sure the checkbox for Show Hidden Files is checked)
  4. Find the .httaccess file.
  5. Open the .htaccess file and or edit the following code at the bottom.
  6. Save the changes you made to 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

Editing your wp-config.php File

If neither of these solutions works for you, you can try editing the wp-config.php file located at your websites root folder.

  1. Log in to your web hosting account and go to cPanel
  2. Click on FILES -> File Manager
  3. Select “Document Root for:” from the Directory Selection and click on Go. (Make sure the checkbox for Show Hidden Files is checked)
  4. Add the following to the very bottom of wp-config.php
@ini_set( 'upload_max_size' , '20M' );
@ini_set( 'post_max_size', '13M');
@ini_set( 'memory_limit', '15M' );

Contact Web Host Support

If none of these solutions works for you, please consult your web host. Your Web host may have configured their server in a way that prevent you to increase file size.

Related content

  • WooCommerce: Fix “Sorry, This File Type Is Not Permitted for Security Reasons” For Downloadable Products
    In WordPress, you get the “Sorry, This File Type Is Not Permitted for Security Reasons” error when you try to upload certain files to the Media library. Similarly, in WooCommerce you may get the same error when you try to upload a downloadable product download files. Why is that? Well, by default WordPress only allows […]
  • WooCommerce: Fix WP Memory Limit issue
    WordPress automatically limits your PHP memory to 40MB. This may result in your WooCommerce website being slow to process information, searches, product uploading and so on.
  • WordPress: Fix “No Update Required” @ WP Admin
    It happened to me today while updating to WordPress 5.3, so I thought of sharing the fix with all the people who are going to have this problem now and in the future. Honestly, I should have thought about this better – but it’s an early Saturday morning and maybe my brain is still asleep. […]
  • WooCommerce: How to Shop As a Customer
    You launched a new feature on your WooCommerce store or added a subscription functionality for your customers but aren’t sure how your customers will take it, if it’ll help them, and wish to review the functionality yourself first? Or, do you take remote orders over the phone and need a solution that lets you place […]
  • WooCommerce: Email Admin Upon Fatal Error
    WooCommerce has a nice feature when it comes to WordPress Error 500 / Fatal Error – it logs the error and all the information regarding it inside the WooCommerce Status > Logs > Fatal Errors area. My problem is that sometimes these errors occur in the backend, so they may not trigger the WordPress built-in […]

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

2 thoughts on “WooCommerce: “uploaded file exceeds the upload_max_filesize” Error

  1. Just one point to add:
    After editing the php.ini file, you need to restart the apache service in order for the changes to take effect.

  2. You could also use this plugin to customise you PHP settings from the WordPress administration pages:
    https://wordpress.org/plugins/custom-php-settings/

Leave a Reply

Your email address will not be published. Required fields are marked *