413 Request Entity Too Large Error: Fix & Prevention Guide

What Is the 413 Request Entity Too Large Error, How to Fix It and Avoid It

If you’ve tried to upload a file, submit a form, or push data to a server and received a 413 Request Entity Too Large error, your request was rejected because it exceeded a size limit set by the server. This error is common on WordPress sites, file upload forms, and API endpoints, and it’s almost always fixable with a few configuration changes.

What the 413 Error Means

What the 413 Error Means

A 413 status code is an HTTP client error response. It tells you that the server understood your request but refused to process it because the request body was larger than the server is configured to accept.

This is different from a browser or network problem. The connection worked fine — the server simply has a size ceiling in place, and your upload crossed it.

In newer HTTP specifications, this status has been renamed 413 Payload Too Large, though many servers and applications still display the older “Request Entity Too Large” wording. Both refer to the same underlying issue.

Common triggers include:

  • Uploading large images, videos, or documents through a website
  • Submitting large forms with file attachments
  • Importing large database files or media libraries
  • Sending large payloads to an API endpoint

Common Causes of the 413 Error

The error usually comes from one (or more) of these size limits:

  • Web server upload limits — Nginx and Apache both have default caps on request body size.
  • PHP configuration limitsupload_max_filesize and post_max_size control how large a single file or form submission can be.
  • CDN or reverse proxy limits — Services like Cloudflare enforce their own upload ceilings, independent of your origin server.
  • Application-level restrictions — Some CMS platforms or plugins impose their own upload limits on top of server settings.

Because multiple layers can each impose their own limit, fixing the error often means checking more than one setting — raising the PHP limit won’t help if the web server or CDN caps the request first.

On WordPress specifically, this error commonly appears while uploading themes, plugins, media files, or backup archives through the Media Library or plugin import screens.

These limits aren’t arbitrary: they help protect servers from excessive memory usage, accidental oversized uploads, and certain denial-of-service attacks.

How to Confirm a 413 Error

Before changing any configuration, confirm what you’re actually dealing with:

  • Check the exact HTTP status code returned in the browser’s developer tools or the response headers.
  • Review server or application error logs for the failed request.
  • Determine which layer is rejecting the request — the web server, PHP, a CDN, or the application itself.

This narrows down which setting below actually needs to change, rather than adjusting all of them at once.

How to Fix the 413 Error

1. Increase Limits in Nginx

If your server runs Nginx, the relevant directive is client_max_body_size. Adding or editing this line inside the server block (in nginx.conf or your site’s config file) raises the ceiling:

client_max_body_size 64M;

 

2. Increase Limits in Apache

On Apache servers, this is typically controlled through LimitRequestBody in your .htaccess file or virtual host configuration:

LimitRequestBody 67108864

 

This value is in bytes, so adjust it to match the file size you need to support.

3. Adjust PHP Upload Settings

If your site runs on PHP (as most WordPress installations do), check and update these directives in php.ini:

upload_max_filesize = 64M

post_max_size = 64M

 

Note that post_max_size should always be equal to or larger than upload_max_filesize, since the form submission that carries the file needs to accommodate it.

4. Check CDN or Proxy Settings

If you’re using a CDN or reverse proxy in front of your server, confirm its upload limit separately. Even after raising server-side limits, a CDN with a lower cap will still return a 413 error until its setting is adjusted or an override is requested.

Developers frequently encounter this error when sending JSON payloads or multipart file uploads that exceed API gateway or web server limits, so the same layer-by-layer check applies when working with APIs rather than a website’s front end.

5. Restart Services After Changes

Configuration changes to Nginx, Apache, or PHP typically require a service restart or reload before they take effect. Skipping this step is a common reason the error persists even after settings look correct.

How to Avoid the 413 Error Going Forward

How to Avoid the 413 Error Going Forward

  • Set upload limits based on real usage. Configure limits high enough for legitimate files (like product images or documents) without leaving them unnecessarily high, which can strain server resources.
  • Compress large files before uploading. Reducing image and video sizes lowers the chance of hitting the limit in the first place.
  • Monitor limits across every layer. Since PHP, the web server, and any CDN can each enforce their own cap, periodically confirm all three are aligned with your site’s actual needs.
  • Communicate limits to users. If your site accepts uploads from visitors, displaying the maximum file size on the upload form prevents confused support requests.

Final Thoughts

The 413 Request Entity Too Large error is a size restriction, not a broken request. Once you identify which layer — PHP, the web server, or a CDN — is enforcing the limit, adjusting the relevant setting typically resolves it. Keeping these limits reasonably calibrated to your actual upload needs helps prevent the error from recurring.

The author
Asher Feroze

I’m Asher Feroze, and I’ve been part of CreativeON for several years, working in various roles including Manager Operations, Business Development Manager, and technical support for our web hosting services. Over time, I’ve gained deep insights into both the business and technical sides of the industry. Now, I use that experience to write informative articles for CreativeON, Gworkspace, and gworkspacepartner.pk, helping readers make smart choices when it comes to web hosting and Google Workspace solutions.

Table of Contents