WordPress upload size limits

Out of the box, WordPress limits uploads (like media files) to no more than 2M. This limit can also be affected by a couple of parameters in /etc/php.ini as well. Details follow.

That 2M is actually turns out to be less something less than a full 2M due to the math around file size calculations.

The following discussion presupposes an enterprise environment where the infrastructure team (quite rightly) has not turned complete control over the web server to the WordPress admins.

To increase that limit you have to of course go into the WordPress admin dashboard (for multisite instances this would be the Network Admin dash) and increase the value under General (or for multisite, Network) Settings across from “Max upload file size”. For example, for roughly 32M you’d enter 32000 KB.

Once that’s done you’ll probably also need to modify two settings in the server’s /etc/php.ini and a reload (using the command “service reload httpd”, rather than a complete restart) the web server.

The two parameters are max_post_size and upload_max_filesize, usually expressed in megabytes. So:

max_post_size = 32M
upload_max_filesize = 32M

You should also check memory_limit to make sure it is well above what you set the above two parameters (on some servers I run this might be as high as 256M depending upon the applications being served).

To effect the latter two changes you do not need to bounce the web server. A reload (service httpd reload or systemctl reload httpd) will do the trick nicely (and minimize disrupting user access to the server).

Most of the advice you’ll see out on the Internet, including the WordPress.org site, will provide various solutions that try modifying these parameters through an .htaccess or internal WordPress environment file. Those won’t work, of course, if the server admin hasn’t given WP permission to totally alter the those sorts of things in the web server configuration (which they’re not as likely to do as your average host provider).

This entry was posted in System Administration, Web on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).