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:
| Setting | What it controls |
|---|---|
upload_max_filesize | The largest single file you can upload. |
post_max_size | The largest whole request. It must be equal to or larger than upload_max_filesize. |
max_execution_time | How long PHP may work on the upload, in seconds. |
memory_limit | Memory 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)
- In cPanel, open Select PHP Version in the Software section.
- Click the Options tab.
- Change
upload_max_filesizeandpost_max_sizeto a value that fits your file, for example128M. Increasemax_execution_timeif large uploads time out. - The changes save automatically.
Option B: MultiPHP INI Editor
- Open MultiPHP INI Editor in the Software section.
- On the Basic Mode tab, select your domain.
- Change
upload_max_filesizeandpost_max_size, then click Apply.
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:
- In cPanel, open File Manager and go to
public_html/wp-content/themes(orwp-content/pluginsfor a plugin). - Click Upload and upload the ZIP file. File Manager handles larger files than the WordPress uploader.
- Right-click the ZIP and choose Extract, then delete the ZIP.
- 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_sizeormax_execution_timeis too low. Raise both. - The limit did not change: an old
php.ini,.user.iniorphp_valueline in.htaccessmay 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.