Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Troubleshooting · Troubleshooting

How to Fix a Small Upload Limit in WordPress

Short answer

WordPress shows the smaller of your PHP upload_max_filesize and post_max_size values as its maximum upload size. To fix a small limit, raise both values in the PHP settings your host reads, with post_max_size larger than upload_max_filesize. Then check the new number under Media > Add New, and look at Nginx, Cloudflare, or Multisite caps if it still does not change.

Key takeaways

  • WordPress shows the smaller of upload_max_filesize and post_max_size, so raise both values.
  • PHP ships with upload_max_filesize at 2M and post_max_size at 8M by default.
  • A .user.ini change can take up to 5 minutes to appear because the cache lasts 300 seconds.
  • Nginx rejects request bodies over its 1m default with a 413 error before PHP sees them.
  • On Multisite, the network Max upload file size defaults to 1500 KB and can cap uploads on its own.

What does a small upload limit mean in WordPress?

A small upload limit means WordPress will refuse a file that is larger than the number shown under Media > Add New.

WordPress has no upload-size setting of its own on a single site. The WordPress Developer Resources page for wp_max_upload_size() says the function reads upload_max_filesize and post_max_size and returns the smaller value.

That function has been in WordPress core since version 2.5.0, as shown on the same WordPress Developer Resources page.

The limit is a server setting, not a WordPress setting. You fix it by changing the PHP settings your site reads, then checking the next layer if the number does not move.

How do you check your current upload limit?

Open Media > Add New and read the line that says Maximum upload file size.

  1. Go to Media > Add New in the WordPress dashboard.
  2. Read the Maximum upload file size line below the upload area.
  3. Note the file size that failed, so you know how much headroom you need.

For more detail, open Tools > Site Health > Info. WordPress.org describes Site Health as a diagnosis of site health, with Status and Info tabs, and says the Info tab gives a granular view of the technical aspects of your site on its Administration Screens page.

Record the values for upload_max_filesize, post_max_size, memory_limit, and max_execution_time. Those four numbers tell you which layer is holding the upload back.

What sets the upload limit on your site?

Several layers can cap an upload, and the smallest one always wins.

LayerSettingWhat it caps
PHPupload_max_filesizeOne uploaded file
PHPpost_max_sizeThe whole POST request
PHPmax_file_uploadsHow many files at once
WordPress MultisiteMax upload file sizeOne file per site
Nginxclient_max_body_sizeThe request body
CloudflareMaximum request body sizeThe request body by plan

The PHP manual lists upload_max_filesize at 2M and post_max_size at 8M by default, with memory_limit at 128M, on its core php.ini directives page.

The same PHP manual page says post_max_size must be larger than upload_max_filesize, and memory_limit should generally be larger than post_max_size. Use that order when you pick new values.

The PHP manual also lists max_file_uploads at 20 by default, so it caps how many files you can send at once, not how large one file can be. See the core php.ini directives page for the full list.

How do you raise the limit in your hosting panel?

Use your host panel first, because it edits the PHP settings your site reads without you touching files.

  1. Open your host panel and find the PHP settings or PHP version area.
  2. Set upload_max_filesize to your target size, such as 64M.
  3. Set post_max_size a little larger, such as 72M.
  4. Save the settings and wait a few minutes.
  5. Reload Media > Add New and check the new number.

Pick a size that fits the files you upload. A 64M limit covers most images, PDFs, and short videos, while a theme or backup file may need more.

If your PHP version is old, read How to Update PHP for WordPress Without Breaking the Site before you change other settings. A newer PHP version can also change which panel options you see.

How do you raise the limit with .user.ini or php.ini?

Use .user.ini on PHP-FPM or FastCGI hosting, and php.ini on a server you control.

Create or edit a file named .user.ini in your site root with these lines:

upload_max_filesize = 64M
post_max_size = 72M
memory_limit = 256M
max_execution_time = 300

The PHP manual page on .user.ini files says those files are processed only by the CGI/FastCGI SAPI, and only INI_PERDIR and INI_USER settings are recognised there. See the PHP manual page on .user.ini files.

The same PHP manual page says .user.ini files are re-read after user_ini.cache_ttl, which defaults to 300 seconds. Wait 5 minutes before you decide the change failed.

If you edit the main php.ini file on a server you control, restart PHP or the web server so the new values load. Then reload Media > Add New and check the number.

Do not try ini_set() in wp-config.php or a plugin for these two settings. The PHP manual lists both as INI_PERDIR, which means they cannot be set at runtime, on its core php.ini directives page.

How do you raise the limit with .htaccess?

Use .htaccess only when PHP runs as an Apache module, because php_value lines do not work on PHP-FPM hosting.

Add these lines to the .htaccess file in your site root:

php_value upload_max_filesize 64M
php_value post_max_size 72M

The PHP manual page on .user.ini files says that if you run PHP as an Apache module, use .htaccess files for the same effect. See the PHP manual page on .user.ini files.

Back up .htaccess before you edit it. A wrong php_value line on the wrong setup can cause a 500 error, so keep a copy you can restore in seconds.

If the site shows a 500 error after the edit, remove the lines you added and follow How to Fix the 500 Internal Server Error in WordPress. Then use the host panel or .user.ini method instead.

What if Nginx or Cloudflare still blocks the upload?

Check Nginx and Cloudflare next if the Media screen still shows the old limit after PHP is fixed.

The Nginx documentation lists client_max_body_size at 1m by default, in http, server, and location contexts, and says a larger body returns a 413 error. See the Nginx core module documentation.

On a server you control, add this line to the server or location block, then reload Nginx:

client_max_body_size 64m;

The Cloudflare Workers limits page lists the maximum request body size as 100 MB on Free and Pro plans, 200 MB on Business, and up to 5 GB self-serve on Enterprise. See the Cloudflare Workers limits page.

Requests over those limits return a 413 error, as stated on the same Cloudflare page. If your file is larger than your plan limit, upload it outside the proxy or split it into smaller parts.

If you use Cloudflare in front of WordPress, check its settings in How to Set Up Cloudflare for WordPress. A proxy cap can hide a PHP fix that already worked.

How do you fix the limit on WordPress Multisite?

On Multisite, raise the network limit too, because it can cap uploads even when PHP allows more.

The WordPress Developer Resources page for Network Admin Settings lists Max upload file size with a default of 1500 KB, and Site upload space with a default limit of 50 MB. See the Network Admin Settings page.

  1. Go to My Sites > Network Admin > Settings.
  2. Scroll to Upload Settings near the bottom.
  3. Raise Max upload file size to the size you need, in KB.
  4. Check Site upload space if the site is near its total quota.
  5. Save the settings and test an upload on that site.

A single site on the network still cannot pass the PHP limit. Raise the PHP values first, then the network value, and confirm both numbers.

How do you confirm the fix worked?

Confirm the fix by uploading a file close to your new limit, not by trusting the settings screen alone.

  1. Reload Media > Add New and read the new Maximum upload file size.
  2. Upload a file that failed before, at a size below the new limit.
  3. Open the file in the Media Library to confirm it arrived intact.
  4. Check Tools > Site Health > Info if the number looks wrong.

If uploads still fail with an HTTP error, see How to Fix the HTTP Error When Uploading Images in WordPress. That error can come from a timeout or a server limit, not only from file size.

When should you call your host?

Call your host when the limit does not move after you change the right file, or when you cannot edit PHP settings at all.

  • Your host caps the value below what you need.
  • Your panel has no PHP settings to change.
  • A .htaccess edit causes a 500 error.
  • Nginx or Cloudflare settings are outside your reach.
  • You are on Multisite and cannot reach the Network Admin.

Ask the host for the exact values of upload_max_filesize and post_max_size on your account, and whether a server cap applies. Give them the file size you need and the error you saw.

What mistakes should you avoid?

Avoid the common errors that leave the limit unchanged.

  • Raising only upload_max_filesize, while post_max_size stays lower and still caps the request.
  • Setting post_max_size equal to or smaller than upload_max_filesize, when the PHP manual says it must be larger.
  • Editing wp-config.php with ini_set(), which cannot change INI_PERDIR settings at runtime.
  • Using php_value lines in .htaccess on PHP-FPM hosting, where they do not apply.
  • Setting a very large limit without checking disk space, since a large file still needs room to land.
  • Forgetting timeouts on slow connections, which can stop a large upload even after the size is fixed; see How to Fix “Maximum Execution Time Exceeded” in WordPress.
  • Raising the size but not the memory, when image work runs out of memory; see How to Fix “Allowed Memory Size Exhausted” in WordPress.

Frequently asked questions

Why does WordPress still show 2 MB after I edited wp-config.php?

WordPress reads the limit from PHP, not from wp-config.php. The two settings that matter, upload_max_filesize and post_max_size, are INI_PERDIR settings, so ini_set() cannot change them at runtime. Change them in your host panel, .user.ini, php.ini, or .htaccess instead, then wait a few minutes and reload Media > Add New.

Should post_max_size be larger than upload_max_filesize?

Yes. The PHP manual says post_max_size must be larger than upload_max_filesize, because post_max_size covers the whole POST request, including the file plus form fields. A common working pair is upload_max_filesize at 64M and post_max_size at 72M. If post_max_size is smaller, WordPress shows the smaller value as the limit.

How long does a .user.ini change take to work?

It can take up to 5 minutes. The PHP manual says .user.ini files are re-read after user_ini.cache_ttl, which defaults to 300 seconds. Wait the full 5 minutes, then reload Media > Add New. If the number still has not changed, check that your host uses CGI or FastCGI, since .user.ini files are processed only by that SAPI.

What is the difference between a small upload limit and a wrong file type error?

A small upload limit is about size, while a wrong file type error is about the file extension or MIME type. A size error says the file exceeds the limit or shows a 413 error. A type error says the file type is not permitted. Raising the size limit will not fix a type error, and allowing a new file type will not fix a size error.

Can a plugin raise my upload limit?

A plugin cannot raise the PHP limit past what the server allows. It can change the value WordPress shows only within the PHP ceiling, or split a large file into chunks so each request stays under the limit. If your host caps PHP at a low value, only the host can raise that cap, so ask support for the exact values on your account.

Sources

  1. wp_max_upload_size() WordPress Developer Resources
  2. Description of core php.ini directives PHP Manual
  3. .user.ini files PHP Manual
  4. Network Admin Settings Screen WordPress Developer Resources
  5. Module ngx_http_core_module NGINX Documentation
  6. Limits Cloudflare Developers
  7. Administration Screens WordPress.org Documentation

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test