How to Change Max File Size Upload Limit for WordPress


This is super easy, despite how difficult it seems to find a straight answer online.

All you need to do is change three parameters in your php.ini file. For Apache, the location of this file is /etc/php/7.4/apache2/php.ini. It may be slightly different for Nginx, but the process is the same.

If you're using a Debian-based Linux install, type the following:

NOTE - The PHP version you are using may be different than the 7.4 listed below, so adjust accordingly.

sudo nano /etc/php/7.4/apache2/php.ini

Find the following three parameters, and change them. You can use different values, but the ratios need to be similar. For example, post_max_size can't be lower than upload_max_filesize.

upload_max_filesize = 40M
post_max_size = 80M
memory_limit = 128M  

Make sure to restart Apache (or Nginx) when you're done.

sudo service apache2 restart

That's it. Good luck.


Don't take my word for it. I'm just a random guy on the internet.