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:
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:
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:
So now we should be able to upload files up to 128 MB, right? Let’s find out in the media library:
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:
Let’s set 128000 KB here, save the settings and go back to the media library file uploader:
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?