I was recently asked if I knew how to increase WordPress’ media upload size. Truthfully, it had been a minute, but I always have some ideas at the ready.
What really blew my mind? The person had already asked their developer. Their developer’s expert take was, and I quote “I’m not sure”.
Guess his Google and/or conversational AI was broken that day.
Why WordPress media uploads are capped by default
In my experience, WordPress is rarely the problem here, even though it may like it, since you’re trying to, you know, upload a file to WordPress. PHP, the technology that WordPress runs on is usually the culprit, having default upload limits of only 2 MB.
PHP configuration (php.ini)
The first play to take a peak is in the php.ini
file that houses the bulk of the PHP configuration for your server. This is typically found in the /etc
directory, something like /etc/php.ini
or /etc/php/8.x/php.ini
.
It’s your server, you really outta know where the php.ini
file it.
There’s a couple of things to look for, or look to see if they exist at all. Search the php.ini
for upload_max_filesize
and post_max_size
, if they are there, they probably have values set to lower than the upload size you’d like to allow. If they aren’t set, you’re running on defaults and you’ll need to add them.
The format for those configuration directions are as such:
upload_max_filesize = 100M
post_max_size = 100M
php.iniOther places to look
While the PHP configuration tends to be the most likely culprit, there are a few other places to look if you’re still having issues.
Your web server could have some limits set. These directives vary by software, so you’ll want to look up the documentation for whatever you’re running. Nginx, Apache, LightSpeed, etc.
Also, and this is a big stretch, the issue may in fact be inside of WordPress. Since the configuration of PHP can actually be done in code, you could very well have some of the aforementioned configuration options hiding out in a WordPress theme or plugin.