I want to upload a file size more than 2MB, How to how to configure exceeds the maximum file size for this site error in WordPress? You are facing the same error?
Don’t worry, every new WordPress Developer encounters the same problem. Every day we receive many questions about, How to configure file size during theme setup in WordPress ?
In this article, We will share 101% working solution with you:
How to configure exceeds the maximum file size for this site error in WordPress.
Please note: These methods will work only when your server have capabilities to do so. If you are using shared hosting at low price. It may be possible your server providers like Godaddy, Hostgator already set highest server performance. Read method 3 given below, or you can ask for paid support by contacting us.
Method 1. Theme Functions File (If doesn’t work try method 2)
There are cases where I have seen that just by adding the following code to the theme’s
functions.php (you can easily access this file -> Appearance -> Editor -> function.php) file, you can increase the upload size:
@ini_set('upload_max_filesize','128M'); @ini_set('post_max_size','128M'); @ini_set('memory_limit','256M'); @ini_set('max_execution_time','300'); @ini_set('max_input_time','300');
This method is reported to work for many users. Remember you can only go up-to max available resource provided by your hosting service provider.
Method 2. .htaccess Method (If doesn’t work try method 3)
For this method you need FTP or cPanel Access. Using the method,
.htaccess where altering 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 at the end of your .htaccess file:
php_value upload_max_filesize 100M php_value post_max_size 200M php_value max_execution_time 180M php_value max_input_time 100M
Method 3: Contacting Your Hosting provider
Many hosting providers limit the amount of usable memory for your server, especially shared hosts or cheap cost hosting providers. In fact, many shared hosting providers don’t even give you access to your php.ini file, so if you’re having trouble fixing an error using that method, your host’s limitations may be the reason.
Therefore, if you have no success by trying to increase your WordPress memory limit yourself. Your last resort is to upgrade your entire hosting package. It might be a good idea to do so, anyway, especially if you’ve been on a shared hosting server for a while.
I hope this article helped you increase the maximum file upload size in WordPress. If you are still having issues, we are a team of WordPress experts you can contact us or post your query at NexGen support forum: https://www.nexgi.com/support