Skip to content

Everything for WordPress, web development — and beyond

The file upload limit in WordPress: how much and where to change it

State the size of the files you need to upload — the tool works out a consistent set of values and shows which method will work on your particular server type. Everything is computed in the browser; nothing is sent anywhere.

How large the biggest file you plan to upload should be.
The WordPress media library sends files one at a time. Custom forms with several fields send them in a single request.
If you are not sure, look at phpinfo(), the Server API line: Apache 2.0 Handler = mod_php, FPM/FastCGI = PHP-FPM, LiteSpeed = LSAPI.
DirectiveWhy exactly this valueValue


    
Why it did not work: a checklist The values are written but the limit has stayed the same — almost always it is one of the nine points below.

A hard limit set by the host. A value above what the plan allows is silently trimmed: 512M in the file, 64M in phpinfo(). The only cure is a support ticket.

You edited the wrong php.ini. The active file is named in phpinfo() on the Loaded Configuration File line; next to it is Additional .ini files parsed — those are read as well and can override your values.

LimitRequestBody in Apache. The web server's own limit, in bytes, in the vhost or in .htaccess. It cuts off the request body before PHP — the user sees 413 while the PHP logs stay empty.

The PHP process was not restarted. php.ini is read once at start-up. For PHP-FPM you have to restart FPM itself — restarting nginx or Apache does not re-read the pool.

.user.ini is not picked up instantly. PHP caches it for user_ini.cache_ttl seconds (300 by default). Wait 5 minutes or restart FPM.

OPcache. It does not cache php.ini itself, but it does cache your wp-config.php with its @ini_set. After an edit, run opcache_reset() or restart the process.

A proxy in front. Cloudflare on the free plan caps uploads at 100 MB; a load balancer, Engintron or nginx in front of Apache has its own client_max_body_size.

A limit imposed by WordPress. Multisite: Network → Settings → Max upload file size (in KB). Plus the upload_size_limit filter, which some themes and security plugins set.

The temporary directory. If upload_tmp_dir is not writable or the partition has run out of space, the file never arrives and there is no clear error. Check sys_get_temp_dir() and the free space.

The calculation runs in your browser — no data about the server is sent anywhere.

Why changing upload_max_filesize alone is almost never enough

The upload size is limited by at least four independent values, and the smallest of them wins. upload_max_filesize — the size of a single file. post_max_size — the size of the whole POST request. It must be larger than upload_max_filesize, otherwise the file is cut off before the first limit is even checked. memory_limit — must fit the entire request; for WordPress, 256M is the minimum. client_max_body_size — the nginx limit. It is the one most often forgotten: PHP already allows everything, but nginx returns 413 Request Entity Too Large. The method is a separate trap. php_value directives in .htaccess work ONLY when PHP runs as an Apache module (mod_php). On modern hosting PHP almost always runs as FPM, and then such a line is either silently ignored or produces a 500 Internal Server Error. That is exactly why the tool asks for the server type and shows which block will actually help you.

Frequently asked questions