Website Guider

The Ultimate Resource for WPadmins and Geeks

5 Easiest Ways to Increase The Maximum Upload Size in WordPress

Hey, are you trying to upload a theme or plugin which exceeds the maximum file upload size? But wait, why would WordPress allow me to upload a file which exceeds the limit.

If you face issues while uploading a large file, it may be due to WordPress’s restrictions. You own a website, you have to upload files often, few of them may fit the current allowed file size, but few may not. While you aren’t allowed to upload large files, that is quite frustrating.

In this tutorial, we will uncover all the things related to Maximum Upload Size in WordPress. Also, we will cover various methods of uploading the files to WordPress.

Let’s begin.

What is Maximum Upload Size in WordPress?

As we already know, maximum describes an amount which is the largest that is allowed or required.

The same concept applies to WordPress. WordPress is primarily built on PHP. Maximum Upload Size is the concept of PHP, not the native concept of WordPress. When you increase the upload size, you are altering the default value set by PHP server settings.

The PHP’s default value of upload_max_filesize is 2MB, which I think is not sufficient.

But, Is it reasonable to increase this limit?

It is sometimes good and sometimes not. You are frustrated with this statement. Let me explain.

If you try to upload a far more size file than allowed, it would be good to increase the limit. There is nothing terrible about raising the limit. It won’t harm anyway.

But, at the same time, it can hurt your storage. For example, it would be nonsense to upload larger files to eat up your storage so fast if you have a limited hosting plan. When you have placed a restriction, you will be notified by the system that you are crossing the limits.

The reason for pointing out that it is a bad idea to increase the limit is because I have seen many people increase the limit to 512MB, which I don’t think is a good idea. Also, the more large file, the server consumes lots of resources.

INFORMATION

You will see 512MB on all screenshots, but I don’t recommend you do this unless you have such need. It is set 512MB for demonstration purposes.

So, I want to convey that you don’t need to increase the upload file size unless you have such a situation. Keep it as minimum as possible. In my opinion, setting the upload_max_filesize to 8 MB - 24 MB is sufficient. You won’t find any theme or plugin larger than 10 MB; if any are found, check the provider first.

How to Upload Larger Files in WordPress without altering Maximum Upload Size

As you already know, we can easily add media to our WordPress-powered website using Media Library.

But there are other ways by which you can easily upload files to your website.

So, we have three ways to upload files in WordPress. They are listed below.

  • Media Library: WordPress provides you such functionality by uploading files, themes, plugins using the backend dashboard.
  • File Manager by Hosting Provider: Almost every host provides access to file manager so that the customer can do CRUD operation and upload as well.
  • FTP: If you have already worked with FTP, you can easily add or removes files from within FTP and do changes without using WordPress built-in media library or file manager.

How to Check the Maximum Upload Size inside WordPress

Two easiest ways exist by which you can quickly check the current upload size. Let’s see both of them.

Media Library

Before diving into the detail, we must be aware of the current maximum upload size. It is easy to check and follow these steps to check the present value of upload_max_filesize.

  • Login to your WordPress Dashboard.
  • On the left side navigation menu, navigate to Media -> Add New.
  • Read the value of Maximum upload file size.
5 Easiest Ways to Increase The Maximum Upload Size in WordPress 1

You can see in the above screenshot the current value which your host sets. Now you know what it is and how to find it.

Site Health Info

Site Health Info tool lets you debug your WordPress-powered website more efficiently. It provides various details related to server configuration and WordPress.

We can check our maximum upload size using this tool. Inside WP dashboard, go to Tools >> Site Health Info >> Media Handling.

5 Easiest Ways to Increase The Maximum Upload Size in WordPress 2

In the above image, you can easily spot the current limit.

Let’s dive directly into the methods/techniques we can use to change the default value of maximum upload file size to increase the PHP upload file size limit.

How to Increase the Maximum File Upload Size in WordPress

While there are numerous ways to solve the problem, but for clarity, these methods might not help due to your host configuration. But, so far, these methods and techniques have worked with all the hosts.

If any of the provided methods doesn’t seem to work, it is recommended to approach the host in that case.

Without any further ado, let’s start.

1. Using Plugin – The most straightforward method

The persons like me don’t know how to edit files. What solution would you propose in this case?

Don’t be shocked; I know how to edit files, but what about those among you who are newcomers and don’t know so much about WordPress or servers.

It would be nice to use the most straightforward option, which is installing the plugin.

Note

Suppose you are an absolute beginner and don’t know how to install plugins. In that case, I recommend reading this article before heading onwards.
How To Choose And Install WordPress Plugins (Complete Guide)

If you google it, you will come across many different plugins, but they do the same thing, increasing the upload limit.

For this purpose, we have selected the plugin by Imagify. The name of the plugin is Increase Maximum Upload File Size.

5 Easiest Ways to Increase The Maximum Upload Size in WordPress 3

Install and activate the plugin, and post-activation, visit the plugin settings panel. Inside the settings panel, you will notice Choose Maximum Upload File Size.

5 Easiest Ways to Increase The Maximum Upload Size in WordPress 4

Please set it to any predefined value, and everything is set. But wait, the plugin tells you more things like the limit set by the hosting provider, and it also tells you the current limit set by WordPress.

This plugin is so helpful because it provides the required information in one place. Remember, I am not bounding you to this specific plugin. There are others also, but I found this one best.

2. Modifying functions.php file

If the plugin method doesn’t work for you, there is a workaround. You can edit your theme functions.php file.

Warning

It is recommended to add these codes to your child theme functions.php file. If you do the changes inside your parent theme, the code snippet will get deleted on the update. Also, the same applies to child theme update.
So, it is better to add these codes using plugins like Code Snippets Plugin or any other.
I also assume that you have experience in editing files in WordPress.

Add these lines of code at the end of the file.

@ini_set( 'upload_max_size' , '24MB' );
@ini_set( 'post_max_size', '28MB');
@ini_set( 'memory_limit', '28MB' );
INFORMATION

You can add the above code snippet to wp-config.php file also.

3. Using .htaccess file

If your web server is running on Apache, you can edit the .htaccess file. It is an important file because it contains configurations for Apache-powered servers.

You have to add few lines of code to and in no time, the max upload size in WordPress will be increased.

The file beginning with a dot is hidden in some cases; if you don’t find one, check “Show Hidden files.”

WARNING

Please take a backup of the .htaccess file to your computer before making any changes. In case something goes wrong, you can quickly restore the file.

You can find the .htacccess file inside your root directory; edit with any editor and put these lines before where it says #END WordPress

5 Easiest Ways to Increase The Maximum Upload Size in WordPress 5
php_value upload_max_filesize 24MB
php_value post_max_size 28MB
php_value memory_limit 28MB

Edit the numbers and set those as you like but remember to set the value post_max_size higher than upload_max_filesize. Visit the WordPress dashboard; check whether the limit is increased or not.

4. Editing or Modifying php.ini file

As a WordPress user, you must know that it is built upon PHP. The server configuration file for PHP is known as php.ini. You can edit this file to increase the currently provided upload size limit.

It efficient way to do it, but you need to be aware of the consequences if anything goes wrong.

For absolute beginners, I won’t recommend this method.

You can find the file in the root directory if it allows you to edit the root directory. As far as I have seen, shared hosting doesn’t allow you to change the server files directly, like php.ini. You have to do it any other way.

So, find the file, and if you don’t see it, check “Show Hidden files” due to security reasons; it is set to hidden.

Once you have located the file, edit it and find/search these lines and change the values as you like.

upload_max_filesize = 24MB
post_max_size = 28MB
memory_limit = 28MB

5. Contacting Hosting Provider

I can’t guarantee whether the methods will work or not due to the limitation set by your host. In case the above methods don’t work, you have to approach your host.

They will be the ones who will specifically assist you in this matter. My other recommendation will be to use this method if you are new to the website platform.

Conclusion

We discussed various methods which let us change the maximum upload size. If nothing seems to work, the host is your best friend.

Do you think these methods are the correct way to do this task? Would you please share your opinion about the strategies I mentioned above? If I missed something, please let me know in the comments section, so a healthy discussion on this topic will occur.

Feel free to comment. Don’t forget to share the tutorial with your mates.

Raashid Din Dar

Raashid Din Dar is a web developer and designer. He specialises in WordPress Theme and Plugin development. Also, Web Designing is what he loves.He loves to read books and play with friends.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top