Do you want to increase the maximum file upload size in WordPress. Some times low file upload size limit can stop you from uploading files via media uploader, or install plugins and themes. In this blog, we will show you how to easily increase the maximum file upload size in WordPress to fix upload limit issues.
How to Check Your Maximum File Upload Size Limit in WordPress?
WordPress will automatically show the maximum file upload size limit when you are uploading images or media. To check it you can simply go to Media » Add New page and you will see the maximum file upload size limit for your WordPress site.
1) WP-Config settings
The wp-config.php file is located in the WordPress root directory.
WP Memory Limit:
This parameter sets the amount of memory used by php and by default WordPress can go up to 40MB. To avoid Memory Exhausted error this parameter should be set to at least 256MB and this can be done from WordPress wp-config.php file.
define( 'WP_MEMORY_LIMIT', '256M' );
2) Theme Functions File
There are cases where we have seen that just by adding the following code in theme’s functions.php file, you can increase the upload size:
@ini_set( 'post_max_size', '64M');3
@ini_set( 'max_execution_time', '300'
3) htaccess Method
Some people have tried using the .htaccess method where by modifying the .htaccess file in the root directory, you can increase the maximum upload size in WordPress. Edit the .htaccess file in your WordPress site’s root folder and add the following code:
php_value upload_max_filesize 64M2
php_value post_max_size 64M3
php_value max_execution_time 3004
php_value max_input_time 300