More fixes

WordPress: "413 Request Entity Too Large"

You upload a theme, a plugin, a video or a big batch of photos and get a plain page saying "413 Request Entity Too Large", or the uploader just says "HTTP error". The file never reached WordPress: the web server in front of it (usually Nginx, sometimes Apache or Cloudflare) has its own size limit and refused the upload. Raising WordPress's or PHP's limit alone does not help while that one stays low. Here is how to tell which limit it is and raise the right one.

What the owner sees

example-bakery.com/wp-admin/update.php?action=upload-theme

What the checks found


  

Which limit is it? (five minutes)

  1. Read the bottom line of the error page. "nginx" means the Nginx limit (client_max_body_size, 1 MB unless someone changed it). "Apache" points to LimitRequestBody. A Cloudflare-branded page means the upload went over Cloudflare's plan limit (100 MB on Free and Pro).
  2. Check what WordPress thinks the limit is. Go to Media, Add New. It prints "Maximum upload file size". If that says 64 MB and a 5 MB file still gets a 413, the server in front of PHP is the low one, not PHP.
  3. Try a small file. A 200 KB photo that uploads fine while a 3 MB one fails confirms it is a size limit, not a permission or security block (that is a 403 or a 406).
  4. Note when it started. A 413 right after moving host, adding a CDN or switching to a new server panel almost always means the new layer came with the default 1 MB limit.

Fix it, safest first

  1. Upload a different way for today. A theme or plugin zip can go up by SFTP or the host's File Manager into wp-content/themes or wp-content/plugins, then be activated in the dashboard. A big video is better on YouTube or Vimeo and embedded anyway; it keeps the site fast.
  2. Ask the host to raise the web server limit. On shared or managed hosting you usually cannot change Nginx yourself. One line to support does it: "Please raise client_max_body_size (and PHP upload_max_filesize / post_max_size) to 64M for my site." Most hosts do it the same day.
  3. On your own server (Nginx): add client_max_body_size 64M; inside the http or the site's server block, test with nginx -t, then reload Nginx. A panel such as Plesk, CloudPanel or RunCloud has the same setting in its site settings.
  4. On Apache: look for a LimitRequestBody line in the site config or .htaccess and raise or remove it.
  5. Raise PHP's limits to match. upload_max_filesize and post_max_size (a little larger) in the host's PHP settings or php.ini. If the server limit is fixed but PHP is still 2 MB, the upload fails with a different message, covered in the upload error guide.
  6. Over Cloudflare's 100 MB: upload that file by SFTP or through a hostname that is not proxied by Cloudflare. Cloudflare's limit cannot be raised on the Free or Pro plan.
  7. Re-test with the same file and check Media, Add New shows the new maximum.

What you see, what it means, what it needs

What you seeWhat it meansUsual fix
"413 Request Entity Too Large" with "nginx" at the bottomNginx's upload limit, often the 1 MB defaultRaise client_max_body_size (host support or server config)
413 page from ApacheLimitRequestBody is set lowRaise or remove it in the site config or .htaccess
Cloudflare-branded 413Upload over the plan's 100 MB limitUpload by SFTP or a non-proxied hostname
"HTTP error" in the media uploader on big files onlyOften the same 413 hidden behind the uploaderCheck the error in the browser's network tab; raise the server limit
"The uploaded file exceeds the upload_max_filesize directive"PHP's limit, not the web server'sRaise upload_max_filesize and post_max_size
413 started right after a host move or new CDNNew layer came with default limitsAsk the host to match the old limits

What not to do

Most 413s are one line from the host's support team, or one line in the Nginx config. If you cannot reach the server settings or the error stays after the change, that is what the box below is for. Related: upload errors, incompatible archive, the link you followed has expired.