
THIS POST MAY CONTAIN AFFILIATE LINKS. PLEASE READ MY DISCLOSURE FOR MORE INFO.
The maximum upload size in wordpress depends on the default configuration set by your web hosting provider.Not just this, but it also depends on the hosting package chosen by you. Generally, if you have unlimited storage account then it is set around 32MB whereas for others with limited storage capacity, this could be as low as 2MB, and keeping in mind the fact that we can use the wordpress upload feature for uploading not only the images but also others files such as PDF, Docs and Txt files. Specially in cases when you want to upload a video, the size would be no less than 10MB for a decent 40-60 second video.
But you need not worry about this as in this article, we will teach you three ways to increase the maximum file upload size to 64MB in WordPress.
Editing Theme Function File
Most of the WordPress themes has this capability to increase the upload size. All you need to do is just edit the functions.php file of the theme which you are using currently.
All you need to do is just add the following three lines at the end of code. [Please take backup of your theme to avoid any kind of inconvenience.
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
Create or Edit PHP.ini
In this method, go to the directory where you’ve installed wordpress. Check if a file by name ‘PHP.ini’ exists. in it exists, just open the file to edit and if doesn’t then create a new file by this name and add the following lines of code to it.
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
.haccess Method
This one is a bit tricky. In this method, you need to find a file by name ‘.htaccess’ in the root directory where you’ve installed wordpress. Before we go on further, we woudl advice you to download/copy the content of existing .htacces file as any error into it can lead to blunders. After taking backup, open the .htaccess file and add following code at the end of it:
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
If none of the above method works, then it means that your hosting provider has not given you enough priviledge to change the upload size and you need to contact them to increase the maximum upload size. We would recommend all the wordpress users to use hostgator as their hosting packages are specially designed for wordpress users.
