Fam Wencong, Kenneth

My Diary

How To Change The Maximum Upload File Size For WordPress

Published: Sunday, January 26, 2020

By default, the maximum upload file size for PHP scripts is set to 2 megabytes and post size is set to 8 megabytes. However, you may want to change these limits. For example, you can set a lower limit to prevent users from uploading large files to your site. To do this, change the upload_max_filesize and post_max_size directives in your php.ini.

To find where is your php.ini located, look at your Loaded Configuration File when you call phpinfo().

To ensure that file uploads work correctly, the post_max_size directive should be a little larger than the upload_max_filesize. For example, the following settings demonstrate how to set WordPress to accept a file upload of 20 megabytes:

upload_max_filesize = 20M
post_max_size = 21M

To view a complete list of php.ini directives, please visit http://www.php.net/manual/en/ini.list.php.