wp knowledge mascot PHP memory

How to Fix Uploaded File Exceeds Max Size Error

Last Updated on April 20, 2022 by WP Knowledge Hub

The Uploaded file exceeds the upload_max_filesize error in WordPress, occurs when uploading large files, themes, or images that are bigger than the server’s limit. Those limits are set in a PHP.ini file on your server and you can typically change them easily in your hosting panel on most major hosts.

Easiest Ways to Fix Uploaded File Exceeds upload_max_filesize error in WordPress

If you use the WordPress Media Library to add an image that’s, let’s say, 1GB, odds are you will see the error message. Of course, 1GB is an extreme example for an image size, but some hosts set the limit to something as small as 2MB. That means, you probably couldn’t upload a PDF or a high-res full-size HD background image in your site.

Here are a few ways you can change that.

Option 1: Editing wp-config.php File

1. Access the public_html folder using cPanel or your file manager in your hosting panel.

2. Find the wp-config.php file. Right-click the file and select the edit option.

3. Scroll nearly to the end of the file and find for the following comment line: /* That’s all, stop editing! Happy blogging. */

4. Add the following code just above that line:

@ini_set('upload_max_size' , '256M' );

5. Save the file and exit. Try to upload your file again. )

Option 2: Edit the PHP settings in your hosting account

Odds are you’re using a host with cPanel or Plesk, or another popular platform like WPEngine or Pantheon. All these hosts have PHP settings you can edit. Just look for the words “PHP Settings” or something similar next to the circular PHP icon and change the following values:

  • upload_max_filesize  to a either 32 or 64. You an even go higher if you must but beware that having HUGE images or PDFs on your site will kill your bandwidth.

Save the settings and exit.

Option 3: Contact Your Hosting Tech Support

If you are still unsure what to do, don’t take any chances. Just email or call your hosting tech support and ask them to increase the Max Upload Size in the PHP settings for your WordPress account, and they will be happy to assist!