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.
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.
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
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.
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
- Login to your WordPress Dashboard.
- On the left side navigation menu, navigate to Media -> Add New.
- Read the value of Maximum upload file size.
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.
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.
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.
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.
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
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' );
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.”
You can find the .htacccess file inside your root directory; edit with any editor and put these lines before where it says
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.
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.