How to Increase the Maximum Upload File Size in WordPress

Did you know that the server upload file size limit can restrict you to upload large media files like video files, huge images, themes, and plugins? Maybe you’ve run yourself into the error “exceeds the maximum upload size for this site” while trying to upload some large media files to your WordPress site. So you are looking for a quick fix to increase the maximum upload file size in WordPress?

Why Can’t I Upload Large Media Files?

Well, in most scenarios, this is not a WordPress error. Then why does this error happen? The upload file size is a server-level setting, and the web hosting providers may set a reasonable upload file size limit due to some technical reasons.

The web servers set this limit for security and efficiency’s sake, as uploading large files in WordPress may result in crashing your servers to a halt.  Another issue that may restrict you to uploads large media files is the memory limit.

How to Check the Maximum Upload File Size Limit?

You can see the maximum upload limit by navigating to the admin panel of your WordPress website. Go to WordPress Dashboard > Media > Add New, and you’ll see the maximum file size limit.

Check WordPress maximum upload file size

In our case, the default size is set to 32 MB. See the below screenshot. If you want to upload a file size larger than the set limit, WordPress will show you an error like ‘filename.jpg exceeds the maximum upload size for this site.’ The solution to this frustrating error is pretty simple.

How to Fix the Maximum Upload File Size Error in WordPress

Let’s move to the methods to modify the upload file size limit. In this complete guide, you’ll learn all the possible and quick ways to increase the maximum file upload size limit in WordPress to meet your needs.

  1. Modify php.ini to Fix the upload_max_filesize Error
  2. Editing the .htaccess file
  3. Edit the wp-config.php file
  4. Contact Customer Support to fix the error.

Method 1: Modify php.ini to Fix the upload_max_filesize error

To increase the maximum upload size limit using this method, access your WordPress site’s root folder using an FTP client like FileZilla or File Manager app in your hosting account’s cPanel dashboard.

Please take a close look at the uploaded file exceeding the upload_max_filesize directive in the php.ini error message; you can assume that it has something to do with php.ini, which contains all of the PHP related variables.

However, if you’re on a shared web server, you will not be able to see a php.ini file in your directory. Your hosting provider has already set the upload file size limit, so it’s impossible to alter php.ini.

You can modify your PHP settings through the PHP Configuration tool on the hosting Panel whenever you want.

However, if you’re using VPS or a different platform, you can edit php.ini to overcome the error. Here’s what you need to do:

  1. Go to your php.ini file and modify it. If you can’t find it, ask your hosting provider for support. Or create a file called php.ini and upload it in the root folder.
  2. Locate the upload_max_filesize and increase file size. You can also boost a few other limitations by adding following code:upload_max_filesize = 256Mpost_max_size = 256Mmemory_limit = 512Mmax_execution_time = 180
  3. Save the file, and you’re done with removing this error. The error should no longer occur. Cross check to verify. You’re ready to upload large media files.

Method 2: Editing the .htaccess File

The secure and quickest approach to resolving this error is using the .htaccess method, where you can increase your PHP resource limit by altering the .htaccess file in the root directory.

The quickest way to solve maximum upload file size error is by increasing your PHP resource limits by changing the .htaccess file. Here’s how to do it:

  1. Login to the hosting Panel and navigate to File Manager under the Files section.
    Access File Manager
  2. Locate the .htaccess file and right-click on Edit
    how to increase maximum upload file size in wordpress (Edit .htaccess file)
  1. Modify the .htaccess file in your website’s root folder and add the code and save the changes.

php_value upload_max_filesize 256M

That’s it! Increase the upload_max_filesize error has been resolved now.

Now, try uploading your file again to check if the error has been resolved. If the error persists, boost a few other PHP limitations 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

Note: You can only modify the PHP limits to any desired values as long as your web hosting providers allow it.

Method 3: Edit the wp-config.php File

Another way to fix the uploaded file exceeds the upload_max_filesize directive in php.ini error is altering the wp-config.php file in your root directory.

Log in to the hosting Panel and access the public_html folder:

Access public_html folder

Now edit the file wp_config.php:

Edit wp-config.php file

Add the following line before the line that says
“That’s all, stop editing! Happy publishing”:

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

Please save the file, refresh your browser, and upload it again! You’re good to go!

Method 4: Contact the Customer Support to Fix the Error

If none of the methods, as mentioned earlier, work for you, contact your web server for support. Ask them to guide you on what steps you should take to solve the maximum upload file size, and hopefully, they’ll sort it out for you.

This guide shows all the possible ways to increase the maximum file upload size in WordPress. However, methods 1, 2, and 3, as listed above (Modify php.ini file, Editing the .htaccess file & Edit the wp-config.php file), are not as easy as installing a WordPress plugin to increase upload file size limit with a single click.

If none of the methods work for you, it’s best to increase the upload file size limit using a plugin, contact your web server and let them do it for you.

Want to know how to backup the WordPress website manually using cPanel? Click here.

I hope this article helps you to increase the maximum upload file size in WordPress. If you have any questions, reach up to me in the comments section below.

Subscribe to our YouTube Channel for more WordPress video tutorials and connect with us on Twitter and Facebook.