How to increase the media upload limit in WordPress by correcting the error "Size of the file exceeds the file size limit for uploading this site".
You want to increase the maximum file upload size in WordPress.
Sometimes the low file upload size limit may prevent you from uploading files via media uploader or installing plugin and themes. In this article, we'll show you how to easily increase the maximum file upload size in WordPress to fix these issues.
Understanding the problem
In the first place, why in the world does this happen? Well, it is important to understand that this is not usually a WordPress issue. In most cases, the maximum upload file size of WordPress is a server-level setting, which also means that unfortunately you can not resolve it in WordPress.
This limit exists for safety and efficiency reasons. This prevents users from flooding your site with huge video uploads and crushing your servers at one stop. We think this is fair enough, but nowadays a default load of 2 or 5 MB (a number of standard default servers) just does not cut it, let's see how we can increase it.
Changing by functions
Add in the theme's functions.php file:
@ini_set ('upload_max_size', '64M'); @ini_set ('post_max_size', '64M'); @ini_set ('max_execution_time', '300');
Questions on how to edit or find this file in WordPress installation? Go to: How to edit functions file in WordPress
Create or edit the file PHP.INI of your server.
Add or change the following values in the file:
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
In some cases the php.ini file comes installed with the upload limit of 2MB, this can cause some problems when uploading media in your wordpress by returning following error "This file exceeds the maximum upload size for this site"
Php.ini is the php configuration file, and it is read when php is started. In the case of not functioning correctly or does not exist in your lodging area contact the technical support of the contracted company.
Through the Htaccess file
Edit or create the file .htaccess in the root of the main directory of your hosting with the following parameters:
Php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
Installing a Plugin
You can install a WordPress plugin that will make this change for you.
Search for "max upload" in Plugins -> Add new, by the administrative panel.
There are several options that you may be installing, choose the one that has the most downloads or best evaluation.