How to Fix the upload_max_filesize Error in WordPress

As scary as this error may seem, the solutions are pretty straight-forward. In this tutorial, you will learn how to fix the error by increasing the default limit of upload_max_filesize through a few methods.

Method 1. Editing the .htaccess File
The quickest fix for the uploaded file exceeds the upload_max_filesize directive in php.ini error is increasing your PHP resource limits by tweaking the .htaccess file. Here’s how to do it:

  1. Login to cPanel and navigate to File Manager under the Files section.
  2. Locate the .htaccess file and right-click to Edit
  3. Add the following line at the bottom of the file:

php_value upload_max_filesize 256M

and Save the changes.

That’s it! Increasing the upload_max_filesize value should automatically fix the error.

Try uploading your file again and if the error persists, Increase additional PHP limits by adding these lines into the .htaccess file :

php_value post_max_size 256M
php_value memory_limit 512M
php_value max_input_time 180
php_value max_execution_time 180

Method 2. Editing the wp-config.php File
Another way to get rid of the uploaded file exceeds the upload_max_filesize directive in php.ini error is by tweaking the wp-config.php file located in your root directory.

All you need to do is log in to the hPanel and access public_html to edit the wp_config. php file. Add the following line before the “That’s all, stop editing! Happy publishing” line:

@ini_set('upload_max_size' , '256M' );

Now Save the file, refresh your web browser, and try uploading again!

Powered by BetterDocs