Skip to main content

Fix: “The uploaded file exceeds the maximum upload size for this site” (WordPress on cPanel)

Getting “uploaded file exceeds the maximum upload size” or HTTP 413 Request Entity Too Large in WordPress? This guide shows how to increase.

C
Written by Christopher Handscomb
Updated over 3 months ago

TL;DR

  • The limit comes from PHP (and sometimes your WordPress network or web server).

  • In cPanel → Software → MultiPHP INI Editor (or Select PHP Version → Options), set:

    • upload_max_filesize = desired size (e.g., 128M)

    • post_max_sizeupload_max_filesize (e.g., 128M or 160M)

    • memory_limitpost_max_size (e.g., 256M)

  • Save, then in WordPress go to Media → Add New and confirm the new Maximum upload file size shown.


Who is this for?

WordPress sites hosted on servers with cPanel (including shared, reseller, or VPS/Cloud with cPanel). If you’re on a Managed plan where server settings are locked down, you may need to contact HostBible Support to apply the change.


Symptoms you might see

  • WordPress error: “The uploaded file exceeds the upload_max_filesize directive in php.ini.”

  • WordPress notice on Media → Add New: “Maximum upload file size: 2 MB” (or another small number).

  • Browser/server error: 413 Request Entity Too Large.

  • Uploads stall at 100% or immediately fail for larger files.


Step 1 — Quick checks before changing settings

  1. Check your current limit in WordPress
    WordPress → Media → Add New (look for “Maximum upload file size: …” at the bottom).

  2. Confirm your file really needs to be that big

    • Images: compress/resize first if practical.

    • Videos: consider hosting externally (streaming/CDN) for better performance.

  3. Verify account disk space/quota in cPanel → Files → Disk Usage. Even with a higher limit, no upload works if you’re out of space.

  4. If you run WordPress Multisite
    Network Admin → Settings → Upload Settings → Max upload file size (KB). This must be your PHP upload_max_filesize.


Step 2 — Increase the limit (Recommended paths in cPanel)

Choose the option that exists in your cPanel. Different providers label these slightly differently.

Option A: MultiPHP INI Editor (recommended on modern cPanel)

  1. Log in to cPanel.

  2. Go to Software → MultiPHP INI Editor.

  3. Basic Mode: choose your domain from the dropdown.

  4. Find and update:

    • upload_max_filesize → e.g., 128M

    • post_max_size128M (or slightly higher than upload_max_filesize)

    • memory_limit256M (or higher than post_max_size)

    • (Optional) max_execution_time300; max_input_time300

  5. Save.

  6. Return to WordPress → Media → Add New and verify the new “Maximum upload file size.”

Option B: Select PHP Version (CloudLinux PHP Selector)

If your cPanel shows Software → Select PHP Version:

  1. Open Select PHP Version.

  2. Click Options (or Switch to PHP Options).

  3. Set the same directives as above (upload_max_filesize, post_max_size, memory_limit, etc.).

  4. Save and re-check in WordPress.


Step 3 — Alternative methods (use only if the options above aren’t available)

Important: On most modern cPanel systems with PHP-FPM, do not put php_value lines in .htaccess (it can cause 500 errors). Prefer MultiPHP INI Editor or a .user.ini file.

A) Per-directory .user.ini file

  1. In cPanel → Files → File Manager, open your site’s document root (usually public_html or the add-on domain’s root).

  2. Create or edit a file named .user.ini and add:

upload_max_filesize = 128M post_max_size = 128M memory_limit = 256M max_execution_time = 300 max_input_time = 300
  1. Save. PHP may take a minute or two to read new .user.ini. Recheck in WordPress.

B) .htaccess (Apache module only; avoid if using PHP-FPM)

If you know you are not on PHP-FPM and your host allows it:

php_value upload_max_filesize 128M php_value post_max_size 128M php_value memory_limit 256M php_value max_execution_time 300 php_value max_input_time 300

If you get a 500 Internal Server Error, remove these lines—your account likely uses PHP-FPM. Switch to .user.ini or the INI Editor.

C) Legacy php.ini (older setups)

Create/edit php.ini in your document root with the same directives. Not all hosts honor this method; prefer the INI Editor or .user.ini.


Step 4 — Confirm the change

  • In WordPress, go to Media → Add New and check “Maximum upload file size”.

  • Try uploading a file just under your new limit (e.g., for 128M, test with a 120–125 MB file).

  • If it still fails, continue with the troubleshooting below.


Troubleshooting if it still doesn’t work

  1. post_max_size must be ≥ upload_max_filesize
    If upload_max_filesize = 128M, set post_max_size to 128M or higher.

  2. Increase memory_limit
    Set memory_limit post_max_size (e.g., 256M). In WordPress, you can also add to wp-config.php:

    define( 'WP_MEMORY_LIMIT', '256M' );

    Note: WP_MEMORY_LIMIT doesn’t change upload size by itself; it just gives PHP more memory to process the upload.

  3. 413 Request Entity Too Large
    That’s often a web server body size limit. On cPanel with an NGINX or proxy layer, this may require a server-level change. Contact HostBible Support if you can’t adjust it.

  4. Plugin-specific caps
    Some plugins (e.g., backup/migration plugins) enforce their own upload limits. Check the plugin’s settings/documentation.

  5. File type vs. file size
    If the error only occurs for certain file types (e.g., .svg, .psd), it could be a MIME type restriction rather than size. Adjust via a plugin or allowlist policy if appropriate.

  6. Caching & propagation

    • .user.ini changes can take a minute or two.

    • If you’re using server-side caching or an accelerator, purge/flush cache and reload.

    • As a last resort, in cPanel temporarily switch PHP version (e.g., 8.1 → 8.2, then back) to nudge PHP-FPM to reload its config.

  7. 500 errors after editing .htaccess
    Remove any php_value lines. Use MultiPHP INI Editor or .user.ini instead.

  8. Large files best practices
    For very large themes/plugins, upload via SFTP to /wp-content/themes/ or /wp-content/plugins/ and unzip server-side (if you have access), or ask Support to deploy. For videos, use a streaming/CDN platform and embed.


Safe example settings

Use case

upload_max_filesize

post_max_size

memory_limit

Typical site (images/docs)

32M

32–48M

128M

Bigger media or plugin zips

64M

64–96M

256M

Large imports/backups

128M

128–160M

256–512M

Set the smallest values that meet your need—very large limits can increase resource usage.


FAQ

What controls the WordPress upload size?
Primarily PHP’s upload_max_filesize and post_max_size. WordPress simply reports the effective limit. On Multisite, there’s an extra network setting. Some servers also enforce a web-server body size limit.

Which should be bigger: post_max_size or upload_max_filesize?
post_max_size must be equal to or larger than upload_max_filesize.

Do I need to raise memory_limit too?
Often yes. Set it at least as high as post_max_size to avoid processing failures.

How do I know the change “took”?
Check Media → Add New in WordPress; the displayed Maximum upload file size will update when the server accepts your new values.


Need help?

If you’re hosted with HostBible and would like us to set a specific limit for you, contact Support with:

  • Your domain

  • Desired upload limit (e.g., 64M, 128M)

  • Any recent error messages (copy/paste or screenshot)

Did this answer your question?