[4 Methods] Increase Maximum File Upload Size in WordPress

Posted on

If you already tried to upload large media files to your WordPress website but failed with an error message, it exceeded the maximum file upload size. In that case, You must need to have increased the Maximum File Upload Size for your WordPress website. This guide contains four different methods of resolving this error.

Almost all of us have seen this error message while uploading large files to our website. This is a standard error for a web developer, especially if you create a site with lots of media such as Music, Videos, Images, Zip Files, etc. I can assure you that it’s a super easy process to resolve this error, even if you don’t have technical knowledge.

This guide covers four different methods of increasing Maximum File Upload Size in WordPress. Not only WordPress website, but you can also follow this guide for any websites that run on Apache, NGINX or cPanel.

Why It’s important to Increase Maximum File Upload Size

There is a size limit for uploading files to the hosting server by default. It’s not WordPress that set this limit but your hosting provider. The maximum upload file size is a server-specific setting. Therefore, it is up to your hosting provider. You can do it quickly if you want to change the settings yourself.

Suppose you want to see your initial file upload size limit head over to Add New under Media in your WordPress dashboard’s sidebar. You can see that maximum upload file size: 2 mb in the below example.

maximum upload file size 2 mb

Some hosts set your limit to as low as 2MB, and others limit it to 40 MB. Some hosts reach a maximum of 150 MB. It is all dependent on the host and the features they’ve decided to offer.

While the limit may be an obstacle for some users, it serves an important reason. The limit on uploads can prevent suspicious users from flooding your website with large files that could make your servers slow. In that case, you may need to limit the upload size based on user roles.

See Also: Best Free WordPress Themes in 2022

It’s crucial to Increase the Maximum File Upload Size if you want to upload a large file to your WordPress website. Now see all of the methods of resolving this error quickly.

4 Methods to Increase Maximum File Upload Size

So, how can you increase the maximum size of your website’s upload? There are four primary ways to accomplish this. Let’s take each of them individually.

Before that, it is essential to remember that each host functions differently. There is a chance that one of these solutions aren’t compatible with your service. I suggest trying one method once in a while until you determine the best one for your requirements.

Add Some Codes into your website’s .htaccess file.

The .htaccess file is a powerful website file that controls the high-level configuration of your website. On servers that run Apache, the .htaccess file allows you to make changes to your website’s configuration without editing server configuration files.

We will add some pre-written codes into the .htaccess file to resolve the Maximum File Upload Size issue. The ThemeRapid team tests all the codes here. You can add these codes to your .htaccess without any hesitation.

php_value upload_max_filesize 280M
php_value post_max_size 280M
php_value max_execution_time 300
php_value max_input_time 300

You can edit your .htaccess file in multiple ways. The easiest way is to download and activate the File Manager plugin in your WordPress dashboard and follow the instructions below.

Head over to WP File Manager from the left sidebar on your WordPress dashboard. After clicking on the File Manager option, you will see the root directory of your website and the .htaccess file as well. Just right-click on the .htaccess file and select the Code Editor option. After that, copy and paste the below code just before the #END WordPress tag.

As you can see, we have written the code to increase the Maximum File Upload Size as per 280M. You can edit this code and write your requirements. If you want to limit the Maximum File Upload Size to 1G you can put 1024M instead of 280M.

Now paste the code before the #END WordPress tag and click on the SAVE & CLOSE option. Done! You just increased your Maximum File Upload Size limit. Now back to the media section and click on Add New. You should see the changes that you just made.

In our case, we applied for 280M, so our limit increased to 280MB, as you can see. This is the easiest way to increase the Maximum File Upload Size limit in WordPress. You can do the same process with the FTP file editor.

The process is the same; you have to log in through an FTP client and edit the .htaccess file.

By creating or Editing Your WordPress Site’s php.ini File

This is almost the same process as the .htaccess file method, and This method will also require you to use the File Manager Plugin to create php.ini in your root directory. However, you have to make a new file named php.ini in the root directory where the .htaccess exists in this method.

This is also another easy method to increase the Maximum File Upload Size limit in the WordPress website. All you have to do is create a file called php.ini, which will override your server’s PHP configuration settings. One of those settings is your maximum upload size.

memory_limit = 128M
upload_max_filesize = 128M
post_max_size = 128M
max_execution_time = 300

You don’t need to have the technical knowledge to do this. Suppose you know how to create and edit a file through WordPress File Manager. So let’s get started on it.

In this method, head over to the WP File Manager option and create a new file, as the above snapshot. The file name should be php.ini. After making the file, hit enter. After that, as before, right-click on the php.ini file and select the Code Editor option.

Please copy the above codes and paste them into the php.ini file and SAVE & CLOSE. You will see a successful message. Done! This is super simple. After that, you can check your WordPress upload screen. The maximum upload file size should now be increased to 128 MB.

By Editing PHP Options on cPanel (only for cPanel Users)

If your website is hosted on a shared hosting server using cPanel and you are familiar with cPanel, this method is for you. This is another relatively simple method to Increase the Maximum File Upload Size limit. As we mentioned before, the maximum upload file size is a server-specific setting.

See Also: How to Install WordPress using cPanel

In this method, we will directly change the option of upload_max_filesize using cPanel. So you must have your cPanel access to continue this process.

Firstly, log in to your cPanel and search for PHP; in the top search bar, you will see an option called Select PHP Version. Click on it and open the PHP Options.

After that, Select OPTIONS, and you will see an option at to bottom called upload_max_filesize. Change the file size limit whatever you want. Boom! You have successfully increased the Upload File Size limit.

This method could be an excellent option if you are a shared hosting user and familiar with cPanel. There are other options for those users who do not have any technical knowledge, neither File Manager nor cPanel. We can’t call it a method but a TIP.

Contact Your Hosting Provider

Yes! Exactly, if you don’t have any technical knowledge, neither File Manager nor cPanel is the best option for you. Go to your hosting provider and create a support ticket to resolve this issue. You can contact them via Live Chat or a Call.

As we mentioned before, the maximum upload file size is a server-specific setting. To create a support ticket or directly contact your hosting provider, they will resolve it for You.

Conclusion

I hope you guys can now increase the Maximum Upload File Size in your WordPress website. These methods are a little bit tricky. Fortunately, you can expand it with a little bit of code or some help from your hosting provider.

This guide has discussed the four most straightforward ways to resolve the Maximum Upload File Size issue.

  • Add Some Codes into your website’s .htaccess File.
  • Create php.ini File in the root Directory
  • Enable PHP Option on cPanel (only for cPanel Users)
  • Contact with the Hosting Provider

Keep sharing this article with your friends and support us. You know! Sharing is caring!

Leave a Reply

Your email address will not be published.