Set the upload limit on a multisite

Last week, a colleague was asking, how you set the upload limit for WordPress. He tried different things, but still the limit was not increased. Let’s take a look, at what you have to do, to raise the limit.

Checking the current upload limit

One of the easiest ways to check the current limit is to upload a new media item. When you navigate to the media library, you will see the current limit:

The Media Library upload showing a "Maximum upload file size: 63 MB"
The Media Library upload showing a “Maximum upload file size: 63 MB”

Here you can see, that we can upload files up to 63 MB. There is a second place in the WordPress dashboard, where you can check the limit, at Tools > Site Health > Info > Media Handling:

The "Media Handling" info of the Site Health Info showing a max. upload size of 64 MB.
The “Media Handling” info of the Site Health Info showing a max. upload size of 64 MB

On this screen, it displays 64 MB. But how do we increase the size, if we need to upload larger files?

Increase the limit on the server level

In order to upload larger files, the server needs to accept them. This is what the “Max size of post data allowed” is telling you. To set those values, you usually have to change the php.ini file:

post_max_size = 128M
upload_max_filesize = 128M

I wrote a blog post about how you can make those changes, without losing them on an update. Depending on the PHP interpreter you use, you might have to restart it. Once we have changed this value, let’s check it in our installation:

The "Media Handling" info of the Site Health Info showing a max. upload size of 128 MB.
The “Media Handling” info of the Site Health Info showing a max. upload size of 128 MB.

So now we should be able to upload files up to 128 MB, right? Let’s find out in the media library:

The Media Library upload showing a "Maximum upload file size: 63 MB"
The Media Library upload showing a “Maximum upload file size: 63 MB”

No, we can’t! It’s still showing only 63 MB. But why? The issue here is, that we are on a multisite, and there is another option we have to change.

Setting the upload limit for a multisite

Navigate to the “Network Settings” and then almost all the ways down to the “Upload Settings”. Here you will still find the lower value:

The "Upload Settings" in the "Network Settings" still showing 64000 KB.
The “Upload Settings” in the “Network Settings” still showing 64000 KB

Let’s set 128000 KB here, save the settings and go back to the media library file uploader:

The Media Library upload showing a "Maximum upload file size: 125 MB"
The Media Library upload showing a “Maximum upload file size: 125 MB”

Now we see our increased file size. If we want to have 128 MB, we need to multiply the value we put into the setting with 1.024, but this should be good enough.

Conclusion

While you might have increased the upload limit on many servers and WordPress installs, and never had an issue. On a multisite, there is one additional setting you have to be aware of.

How about you? Are you using multisite installations? Why, or why not? Have you also found some strange differences, you sometimes forget about?

Posted by

Bernhard is a full time web developer who likes to write WordPress plugins in his free time and is an active member of the WP Meetups in Berlin and Potsdam.

Leave a Reply

Your email address will not be published. Required fields are marked *