Updated: September 22, 2021

WordPress: Increase Upload Size

Written by Purushottam Kiri

Having trouble uploading files to your WordPress website? Learn how to increase the upload size limit On your Website in this article.

What is WordPress Increase Upload Size error?

This error is generated when the media file we are trying to upload is larger than the limit set on your website. This can be caused either by the WordPress site or the restrictions at the host. Many hosts keep their upload limit too low, which in turn causes this problem. This is not always a case with WordPress. Sometimes, the WordPress maximum upload size is a server-level setting which means this can’t be resolved from within WordPress. This is a security measure to prevent users from flooding the site with huge capacity videos, etc.

How to Check Your Maximum File Upload Size Limit in WordPress?

Before proceeding on how to increase upload size for any media in WordPress, first check the maximum upload limit. For this, go to ‘media’ and then to ‘add new’ page and there you will find this maximum file upload size limit for your WordPress site.

How to increase the WordPress maximum upload File Size:

 

1. Increase Upload Size Limit on a WordPress Multi-site Install

If you run a mult-isite installation, you may be able to control upload limit for your site. But this doesn't let you avoid the server level settings. You can't exceed the limit set by the server. You can extend your limit under the limit of the server. This can be done in two main steps:

Step 1:

Open settings on network admin from your WordPress dashboard.

 

Step 2:

Now go down and double check the “max upload file size” settings.

Step 3:

Now you can increase that from the default value to under 1.5 MB and save changes. Its default value is 1500 KB.

 

2. Ask Your Host For Help:

If you are a non-techy and prefer getting this problem solved from experts, you should surely contact your host. Many hosting companies provide chat support that helps in faster communication and troubleshooting. Uploading limit is a complex job for non-techy people but its a job of minutes for the technical team. So, itis always a better option to reach out for help to your host. This can save you time and effort.

3. Modification in Server Settings:

There is a need to make a change in the server settings that affect the handling of uploads by WordPress. In some cases, the necessary setting changes to be made are less than the numerous changes made. There are three main things needed to be made changes in. they are post_max_size, upload_max_filesize, memory_limit.

Setup Guide:

1. Post_max_size:

It sets the maximum size of the post. It also has to effect on file upload.

2. Upload_max_filesize:

To upload a larger file, their values must be larger than upload_max_filesize.

3. Memory_limit:

Memory_limit also affects file uploading. In general words, this should be larger than post_max_size.

These values can be modified using the following methods:

Method 1: Change in PHP options of cPanel:

If the host you are running on uses cPanel, then you can make modifications in it by using the UI. go to ‘software’ and click on “Select PHP Version”

Now select “switch to PHP options”.

Here you can click on an individual property to change its value. Now click on ‘save’.

Method 2: change in php.ini files:

Your server setup is governed by php.ini files by default. To edit your php.ini files, first, you need to login to your site via FTP or SSH. now go to your site’s root directory and open or else create the php.ini file.

If the file is already present, make the necessary changes in the three settings. If you just created the file, and those settings aren't found, paste this code and change values as per your requirement.

upload_max_filesize = 12M
post_max_size = 13M
memory_limit = 15M

In case of some hosts, they need you to add PHP directive in your .htaccess file for these php.ini file settings to work. You can do this by editing your .htcaccess file, which is located at the root of your site and add this code at top of the file:

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/yourusername/public_html
</IfModule>

Method 3: Change in the php.ini file in cPANEL:
 
Step 1:

If you use cPanel, the php.ini file can sometimes be modified via MultiPHP INI Editor tool. Go to ‘software’ and click on “MULTIPHP INI Editor”.

Step 2:

Now select your home directory from the drop-down menu. This home directory is the domain root.

Step 3:

Now make a change in the value of upload_max_filesize. Make it larger than what it is by default.

Method 4: Change in .user.ini Files:

In case if your host has global settings locked, login to your site via FTP or SSh. now go to your site’s root directory and open .user.ini file. Paste the following code in there. If there isn't this file, create one and then paste the code:

Method 5: Change in .htaccess files:

You can also modify server behaviour by making changes in settings of a special hidden file in .htaccess. You can make changes to a directory specific level.

Step 1:

To begin with, login to your site via FTP or SSH. now scan your root directory for the .htaccess file.

Step 2:

When you find that, you can edit that file and add the necessary code to increase upload limit. Add this code in that:

php_value upload_max_filesize 12M
php_value post_max_size 13M
php_value memory_limit 15M

Step 3:

There is a probability that you may get a message, “internal server error”. It means that your server is running PHP in CGI mode. This doesn't give you access to use above commands in the .htaccess file. Now you need to use another method.

Method 6: change in ini_set() PHP function:
Step 1:

Login to your sites via FTP or SSH.

Step 2:

Scan for the wp-config.php file which may be present in the root of your site.

Step 3:

Now in the wp-congig.php file, add the following code:

@ini_set( 'upload_max_size' , '12M' );
@ini_set( 'post_max_size', '13M');
@ini_set( 'memory_limit', '15M' );

Method 7: Change in Theme Functions File:

You can increase the upload size by just adding this code in the theme’s functions.php file:

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

@ini_set( 'post_max_size', '64M');

@ini_set( 'max_execution_time', '300' );

4. Utilize the WordPress upload_size_limit Filter:

In WordPress 2.5, a new filter was introduced. It was upload_size_filter. It helps in increasing the upload file size. An example code of that was given by Grew Jaynes:

/** Filter the upload size limit for non-administrators.

* @param string $size Upload size limit (in bytes).

* @return int (maybe) Filtered size limit.

*/

function filter_site_upload_size_limit( $size ) {

// Set the upload size limit to 60 MB for users lacking the 'manage_options' capability.

if ( ! current_user_can( 'manage_options' ) ) {

// 60 MB.

$size = 60 * 1024 * 1024;

}

return $size;

}

add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 20 );

 

5. Double Checking the Maximum Upload File Size:

There may be a probability of confusion. The post_max_size set in child directory overwrites the same directive in parent directory too. Thus, this leads to confusion.

6. Upload Files Via FTP:

If you are facing trouble in getting your limits raised through your host, you can upload your large files via FTP or SFTP. now you can use the free Add From Server Plugin. This is an ideal process for numerous large files.

7. Directly From The Platform:

Some WordPress hosting providers have a built-in feature that allows you to change the file size limit. You can process it by following these steps:

Step 1:

Over the bar on top, go to ‘servers’. Choose your desired server.

 

Step 2:

Open ‘settings and packages’ from the left panel

 

Step 3:

You will find an “upload size” under the basic settings tab and change it according to your requirement.

8. Plugin:

WordPress has a plugin for every task you don't want to do for yourself.

Step 1:

Over the dashboard of your WordPress, go to plugins.

Step 2:

Select “add new” and search for “increase upload max filesize plugin” from the top right corner

Step 3:

Install it and activate it.

Step 4:

Now go to settings of this plugin.

 

Step 5:

In upload size, enter new size as per your requirements.

Frequently Asked Questions

    Written by Purushottam Kiri

    Purushottam Kiri is one of the partners at Counsellr and is an on-page SEO maniac. With 9 years of experience with WordPress and Content Production, he has founded two SaaS companies, both around Content and SEO.

    Leave a Reply

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

    More From
    About Us
    Counsellr Web Development And WordPress Services

    A202, Babylon Tower,
    VIP Chowk, 
    Raipur, C.G. ,
    India
    Navigation
    magnifiercross