While uploading a file sometime wordpess throw Error “Exceeds the maximum upload size for this site”, Why this error ?
In this article I’m going to explain you why do you face this issue in the wordpress website. The file size upload limit of your wordpress by default is 2MB Mostly and depends on your hosting provider.
See the attached Screenshot below.
As you can see your file upload limit in the image. This is the file limit of your wordpress website. This can vary according to your hosting provider.
Way to Upload File on WordPress:-
1: The easiest way to upload File to WordPress is Media. WordPress gives you option to upload Media file or you can drag and drop also.
2 : You can upload File to WordPress by using File Manager on your Hosting.
3 : FTP is another way to upload Media to WordPress, you can connect to your server via FTP( for example by using FileZilla)
1 – Increasing File Upload Limit by Adding Code to the Themes Function
This is very simple to add code into function.php file, This method also works for many websites maybe not for all, Just follow these steps
1: Go to the “Appearance” menu and click on the “Editor”.
2 : From the list of ‘Theme Files‘, choose ‘Theme Functions‘ (functions.php).
3 : Add this code into your Function.php File.
@ini_set('upload_max_size','64M'); @ini_set('post_max_size','64M'); @ini_set('max_execution_time','300');
2 : Insert Code into the PHP.Ini File to Increase Upload Size
To perform this task you will have to go to your Root Directory of the website by using FTP or You can use File Manager also on your hosting. Maybe “PHP.ini” is already there or maybe not, if this file is not present there you will have to create one for yourself and the add the following code into this file.
upload_max_filesize=64M post_max_size=64M max_execution_time=300
If this code works for you then really a Good news, if it doesn’t work try changing this code accordingly.
upload_max_files=25MB post_max_size=27MB memory_limit=30MB
Editing the .htaccess File to Increase Upload Size
Editing the .htaccess file is very easy, this file exists in the root directory of your website. Maybe you can not find this file beacuse all the file which start wiht dot (.) are hiiden. SO you will have to set hidden file to visible and then edit. Insert the following code into the file.
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
Using a Plugin to Increase Maximum Upload Size
Using a Plugin is a good choice for them who are not familier with adding code into the File. There are many Plugins available to perform this task easily you can choose Increase Max Upload Filesize.
Go to the Plugin and click “Add New”.
Search for the Plugin “Increase Max Upload Filesize”
Install it and Activate and Folloe Plugin instruction to use this.
You can set File Upload Limit as you want.
Contacting Your Hosting Provider
After all of these if still you are unable to increase Upload File Limit, then you can contact your hosting provider to increase the Max File Upload limit, They can set it for you.
So this article is for Incresing file limit, I would like to hear which method worked for you.
Please comment and let me know.