Running Bulk Smush and getting hit with HTTP 413 Payload Too Large? That message is not really about Smush. It is your server saying: “This request is bigger than I am willing to handle.” In practice, that almost always means your upload or POST size limits are too low for the batch of images Smush is trying to process.
Smush shows “HTTP 413 Payload Too Large” when I run Bulk Smush. How do I fix this without breaking my site?
HTTP 413 Payload Too Large means your server understood the request, but rejected it because the body was bigger than its configured limit.
When it happens during Bulk Smush, it usually comes down to one of these:
upload_max_filesize, post_max_size, etc.) are too low for the images Smush is trying to optimize in one go.client_max_body_size on Nginx.The good news: this is a configuration limit, not a permanent Smush bug. Once the limits and image sizes are under control, Bulk Smush will run normally again.
Before changing settings, make sure 413 really is the cause.
If you see 413 in the network log and a relatively small max upload size (for example 2 MB, 8 MB, or 16 MB), you are dealing with a server limit that is too low for your current images.
On many shared hosts, the 413 error during Bulk Smush is caused by PHP limits that are too low for larger images or for the way Smush batches requests.
upload_max_filesizepost_max_sizememory_limit (to give PHP breathing room)max_execution_time and max_input_time (so long operations do not time out mid request)As a starting point, many image heavy sites use something like:
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300
If your host gives you a PHP editor or “MultiPHP INI Editor” in cPanel or a similar panel, use that.
.htaccess (Apache and LiteSpeed)If you are on Apache or LiteSpeed and cannot find a PHP editor, you can often raise limits in .htaccess.
.htaccess file (back it up first).<IfModule mod_php.c>
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
</IfModule>
If you get a 500 Internal Server Error right after editing .htaccess, remove those lines and ask your host to set the values for you instead. Some servers do not allow php_value overrides.
If PHP limits look fine, the 413 may come from the web server or a proxy in front of it.
Nginx uses client_max_body_size to control how big a single request body can be.
nginx.conf or a per site include).client_max_body_size 64m;
This is the exact directive many Smush users had to increase when they saw 413 errors behind an Nginx reverse proxy.
If you are using a reverse proxy, a container proxy, or a CDN like Cloudflare, there may be a separate upload limit there as well.
Even with higher limits, it is smart to reduce how heavy each request is, especially if you have huge originals from a camera or design tool.
Smaller originals mean smaller thumbnails and smaller request bodies during Bulk Smush.
If Bulk Smush always fails around the same point, you may have a few outlier images that are much larger than the rest.
This takes pressure off the server without forcing you to raise limits indefinitely.
Sometimes the 413 response or a similar block comes from a firewall layer, not from plain PHP or the web server.
If Bulk Smush works with the firewall disabled but fails when you re enable it, you will need a permanent allow rule for Smush related requests.
Not comfortable editing configs or do not have access to them? That is normal on many managed or shared hosts.
In that case, contact your host with a message like this:
Hi,
When I run the Smush Bulk Smush tool in WordPress, I get an HTTP 413 "Payload Too Large" error.
Can you please:
- Increase the PHP limits (upload_max_filesize, post_max_size, memory_limit, max_execution_time), and
- Increase any web server or proxy request body limit (such as client_max_body_size on Nginx)
so that Bulk Smush can process batches of images without hitting size limits?
Thank you.
Once you have raised limits and tamed the biggest images, check that:
Hit Continue Chat below and tell me:
upload_max_filesize and post_max_size.I will walk you through a configuration that fits your setup.
Scroll down to the contact form below. Enter your name, email, and WordPress needs. Atiba will get back to you as soon as possible.
WP Assistant is a free tool created by Atiba Software, a WordPress design and development company located in Nashville, TN. If you need more personalized WordPress assistance let us know, and we’ll get back to you ASAP!