Do you want to increase the maximum file upload size in WordPress.
By default, PHP file upload size is set to maximum 2MB file on the server, but you can increase or decrease the maximum size of file upload
If you’re uploading large media files or installing large plugins, that time tou are getting “The uploaded file exceeds the
upload_max_filesize directive in php.ini” errors when uploading files via media uploader?
In this guide, we’ve seen several different methods to increase the maximum upload file size in WordPress:
Table of Contents
Check the Maximum file upload size limit
To check what is the current max upload size limit in your WordPress site then navigate to WP Admin → Media → Add New. You will see the current max upload size on the bottom as shown in the screenshot.
If the current max upload size limit meets your recuirment then you can leave it as it is. However, if it doesn’t then don’t fret, there are many ways you can increase the max upload size in WordPress.
Three Ways to Increase WordPress Maximum File Upload Size
Here, we will uncover how to increase the maximum file upload size in WordPress to fix this issue.
1. Update .htaccess file
If your web server is using Apache and PHP is set as an Apache module, then you can add a few lines of code in your WordPress .htaccess file to increase the max upload size in WordPress.
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
2. Update Functions.php File
If you’re not comfortable editing WordPress core files, you can also upgrade the maximum file upload limit by editing the theme files.
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M');66 @ini_set( 'max_execution_time', '300' );
You can easily increase the size limits by adding the following lines of code in the functions.php file of your theme.
3. Create Or Modify PHP.Ini File
This method is most suitable for WordPress sites with VPS hosting as shared hosting providers generally don’t allow editing the php.ini file.
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
This method is reported to work for many users. Remember if 64 doesn’t work, then try 10MB (sometimes that work).
If these methods don’t work for you, it’s best to reach out to your hosting provider and let them alter it for you.
We hope this article helped you increase the maximum file upload size in WordPress. All of these methods get the job done efficiently so choose the one that you like best.
Still have any questions about how to increase the maximum file upload size in WordPress? Ask us in the comments!
If you liked it, please feel free to check out some of these articles as well!