How to Fix: WordPress error: uploaded file exceeds the upload_max_filesize directive in php.ini?

This error usually occurs when you try to upload large files such as large images, videos, themes, and other media files to your WordPress website.

So here we will guide you through some simple methods to fix this error. We can fix this error by increasing the default limit of upload_max_filesize.

Method - 1 Edit the wp-config file

Please refer to the below steps to increaseupload_max_filesize

1. Log in to your hosting account in cPanel.

2. Open file manager and go to public_html

3. Now open the wp-config file and add the below line at the bottom of the file.


@ini_set('upload_max_size' , '64M' ); @ini_set( ‘post_max_size’ , ‘64M’ );

Method - 2 Increasing the max upload size in the php.ini file.

You can update the php.ini file if you are using VPS with cPanel installed.

1. Log in to your cPanel account.

2. Click on the MultiPHP INI Editor under the software section.


3. Select the website for which you want to update the file size.

php.ini select

4. Scroll down and locate the upload_max_filesize and max_post_size options change the value to 64MB in the text bar.


Was this answer helpful?

« Back