Increase maximum upload file size in WordPress
When you upload a file to your WordPress Media library, you may see an error message if the file exceeds the maximum upload size. Follow these steps to prevent the error by changing your PHP settings in the PHP initialization file.
- Check out our article about the filename for PHP initialization files to find out the name of the PHP initialization file your hosting account uses. For example, if you have Linux Hosting with cPanel, the filename is .user.ini.
- Connect to your hosting account with FTP or File Manager.
- In the root directory of your hosting account, look for the file from step 1. That's the file you're going to edit in step 5.
- If you can't find the initialization file in the root directory, use a text editor (for example, in cPanel use File Manager) to create the file and then save it in the root directory. Be sure you name the file as specified in our article.
- Add the following code to your file. If the code already exists, just edit the XXX values.
upload_max_filesize = XXXM post_max_size = XXXM
You should replace XXX with the number higher than the size of the file you're trying to upload. For example, if your file is 58.6 MB, you can replace XXX with 59. Make sure to keep M at the end, as it's related to units. - Use a phpinfo file to confirm that the change is applied.
After you reload the WordPress dashboard in a browser, you should be able to upload the file without any errors.
More info
- In WordPress, you can also increase the maximum upload file size with a plugin. Choose a plugin from this list that best suits your needs.
- Troubleshooting WordPress