Knowledgebase

How to fix "The uploaded file exceeds the upload_max_filesize directive" in WordPress

When you try to upload a theme, plugin, video or backup file in WordPress and see "The uploaded file exceeds the upload_max_filesize directive in php.ini", the file is bigger than the maximum upload size PHP allows. This guide shows you how to check the current WordPress upload limit, raise it from cPanel, and upload very large files another way when raising the limit is not the best option.

Step 1: Check your current limit

In the WordPress dashboard go to Media → Add New. Under the upload box you will see Maximum upload file size. You can also open Tools → Site Health → Info → Server to see upload_max_filesize, post_max_size and memory_limit.

Step 2: Raise the limit from cPanel

The upload size is controlled by these PHP settings:

SettingWhat it controls
upload_max_filesizeThe largest single file you can upload.
post_max_sizeThe largest whole request. It must be equal to or larger than upload_max_filesize.
max_execution_timeHow long PHP may work on the upload, in seconds.
memory_limitMemory available to PHP. Large imports often need more.

Depending on your server setup, cPanel shows one of these tools. Use the one you find:

Option A: Select PHP Version (CloudLinux)

  1. In cPanel, open Select PHP Version in the Software section.
  2. Click the Options tab.
  3. Change upload_max_filesize and post_max_size to a value that fits your file, for example 128M. Increase max_execution_time if large uploads time out.
  4. The changes save automatically.

Option B: MultiPHP INI Editor

  1. Open MultiPHP INI Editor in the Software section.
  2. On the Basic Mode tab, select your domain.
  3. Change upload_max_filesize and post_max_size, then click Apply.
Keep the numbers reasonable. Set only what you need. The values you can choose may be capped by your hosting plan. If the option you need is not available or the change has no effect, open a ticket and our team will check the limits for your account.

Reload Media → Add New to confirm the new maximum. If you also want to change the PHP version, see How to change the PHP version.

Step 3: Upload large themes or plugins without the browser

For a theme or plugin ZIP that is still too large, you do not need to change PHP at all:

  1. In cPanel, open File Manager and go to public_html/wp-content/themes (or wp-content/plugins for a plugin).
  2. Click Upload and upload the ZIP file. File Manager handles larger files than the WordPress uploader.
  3. Right-click the ZIP and choose Extract, then delete the ZIP.
  4. Go back to WordPress and activate the theme from Appearance → Themes or the plugin from Plugins.

For very large files, use an FTP program such as FileZilla. See How to upload your website (File Manager and FTP).

Common problems

  • "The link you followed has expired": this usually means post_max_size or max_execution_time is too low. Raise both.
  • The limit did not change: an old php.ini, .user.ini or php_value line in .htaccess may be overriding your setting. Remove old overrides and use one method only.
  • "Are you sure you want to do this?" when uploading a theme: the file is too big or it is not a real WordPress theme ZIP (for example, you uploaded the full package from the marketplace instead of the theme ZIP inside it).
  • Images fail with "HTTP error": try a smaller image or raise memory_limit. Resizing photos before upload also helps your site speed.

Frequently asked questions

What upload size should I set?

Use the size of the largest file you really need plus a little extra. Very high values do not make the site faster, and huge uploads through the browser are better done by FTP.

Can I change the limit in wp-config.php?

No. upload_max_filesize is a PHP setting, so it must be changed in PHP's configuration, as shown above. Constants in wp-config.php cannot raise it.

Why are big images bad even if the upload works?

Large photos slow your pages. Compress and resize them first. Read How to Speed Up Your WordPress Website for more.

Need help? Open a support ticket or message us on WhatsApp +20 127 113 3655.

  • upload_max_filesize, post_max_size, WordPress upload limit, increase maximum upload size, MultiPHP INI Editor, upload theme error, رفع ملف كبير ووردبريس, حجم الرفع في ووردبريس

Was this answer helpful?

0 Users Found This Useful