Error 413 · configuration
413 Payload Too Large
You tried to upload something bigger than the server accepts, and it rejected the request before reading it all.
Also seen as: Request Entity Too Large · 413 error · upload failed file too big · exceeds the maximum upload size
What it actually means
The server has a maximum request size and your upload exceeded it. It refused the whole request rather than accepting a partial file.
What makes this confusing is that four separate limits can cause it, and they’re set in different places. Raising one and finding nothing changed means you raised the wrong one:
| Setting | What it caps |
|---|---|
upload_max_filesize |
The size of a single uploaded file |
post_max_size |
The whole POST body, including all files and form fields |
memory_limit |
Total memory for the request |
| Web server limit | LimitRequestBody in Apache, client_max_body_size in nginx |
The effective limit is the smallest of these. WordPress shows you the result on its media upload screen as “Maximum upload file size”.
They also have a required ordering: post_max_size must exceed upload_max_filesize, and memory_limit should exceed both. Setting upload_max_filesize to 64M while post_max_size stays at 8M achieves nothing.
Why it happens
The file is genuinely larger than the limit
Shared hosting commonly caps uploads between 2 MB and 64 MB. Modern phone photos and any video will exceed the lower end of that easily.
You raised one limit but not the others
The most common frustration. Raising upload_max_filesize alone does nothing if post_max_size is lower, because the whole POST body is still capped.
Uploading several files at once
post_max_size covers the entire request. Ten 5 MB files in one submission is a 50 MB POST body, even though no single file is close to the per-file limit.
A proxy in front has its own limit
Cloudflare caps upload size by plan — 100 MB on free. Your origin can accept more and the request still won’t reach it.
How to fix it
1. Find out what the limits actually are
Don’t guess. Create a file, load it once, then delete it:
<?php
foreach (['upload_max_filesize', 'post_max_size', 'memory_limit',
'max_execution_time', 'max_file_uploads'] as $key) {
printf("%-22s %s\n", $key, ini_get($key));
}
The smallest of the first three is your real ceiling.
2. Raise them together, in the right order
Create or edit php.ini in your web root:
upload_max_filesize = 64M
post_max_size = 128M ; must exceed upload_max_filesize
memory_limit = 256M ; should exceed post_max_size
max_execution_time = 300 ; large uploads take time
Some hosts use .user.ini instead of php.ini. Changes can take a few minutes to apply because PHP caches the file.
If your host caps these above PHP, the values will silently clamp — check with the script above rather than assuming they took effect.
3. Try .htaccess if php.ini has no effect
<IfModule mod_php.c>
php_value upload_max_filesize 64M
php_value post_max_size 128M
</IfModule>
The IfModule guard matters. Without it, a server running PHP as FastCGI rather than a module treats php_value as an unknown directive and returns 500 Internal Server Error on every page.
4. Upload large files over FTP instead
The upload limit applies to HTTP. FTP has no such cap.
For WordPress media, upload the files into wp-content/uploads/YYYY/MM/ over FTP, then use a media-library-import plugin to register them. It’s the standard way to move a large media library and it avoids the limit entirely.
5. Compress before uploading
A 12 MP phone photo is often 6 MB and looks identical at 500 KB once resized to a sensible width. If you’re hitting upload limits with images, the limit probably isn’t the actual problem — nobody needs a 6000-pixel-wide image on a web page.
On CWP specifically
CWP free accounts cap uploads at 10 MB per file over HTTP. FTP has no per-file limit, so large media is best uploaded that way and imported afterwards.
Raising upload_max_filesize past the account ceiling has no effect — the limit is enforced above PHP.
When this means you've outgrown free hosting
Regularly needing to upload files above the plan’s cap — video, large design assets, big datasets — is a real constraint that configuration cannot work around.
Worth asking whether the files should be on your web host at all. Object storage or a dedicated media service is usually cheaper and faster than hosting large files from a shared account.
Related errors
-
500
500 Internal Server Error
Something in your application or server configuration crashed, and the server is deliberately withholding the detail from visitors — the real message is in your error log. -
TIME
Maximum execution time exceeded
A PHP script ran longer than allowed and was stopped — almost always waiting on a slow query or a slow external service. -
MEM
Allowed memory size exhausted
A PHP script asked for more memory than your account allows, so it was killed part-way through.
Post the exact error and your account name on the community forum — staff and other users answer there, and the thread helps the next person who hits this.