How to Increase the WordPress Maximum Upload File Size

By Daniel Pataki Updated on June 04, 2018

If you are reading this post, no doubt you have run into an issue uploading files to your WordPress site and are looking for a quick fix. The all too common “exceeds the maximum upload size for this site” error can be very frustrating. Many hosts keep this limit low by default. So in this post, we will dig into the root of the problem and provide you with some quick ways to resolve this issue and get back to uploading your files.

max upload size error in wordpress

Max upload size error in WordPress

First of all, why in the world does this happen? Well, it’s important to understand that this is usually not a WordPress issue. In most cases, the WordPress maximum upload file size is a server-level setting which also means that unfortunately, you can’t resolve it from within WordPress.

This limit exists for security and efficiency’s sake. It prevents users from flooding your site with huge video uploads and grinding your servers to a halt. We think that’s fair enough, but nowadays a default upload of 2 or 5 MB (an amount many servers default to) just doesn’t cut it, let’s see how we can go about increasing it.

Increasing The WordPress Maximum Upload File Size

There are three basic ways you can go about resolving the WordPress maximum upload file size issue, as well as an alternative option. We’ll start with the two easiest ones, then move on to changing the server settings yourself, as there are a number of options there as well.

Increase Upload Size Limit In a Multisite Install

If you are running a multisite installation you may be able to control the upload limit for your sites. Note: This can not circumvent the server-level settings. If the server is set to a limit of 5 MB and you set 10,000 KB (10 MB) in the network settings it will not work. If, however, the server is set to 20 MB and your network settings are set to 1,500 KB you will be able to resolve the issue by increasing the setting up to the 20,000 KB limit. Follow the steps below to increase the max upload size on your Multisite install. If you need to modify the server, skip down to modify server settings.

Step 1

In your WordPress dashboard click into Network Admin and into Settings.

multisite network settings

Multisite network settings

Step 2

Scroll down and double check the “Max upload file size” settings. You can increase this to something higher than the default of 1500 KB (1.5 MB). Then click “Save Changes.”

change multisite max upload file size

Change Multisite max upload file size

Ask Your Host For Help

If you are having trouble with uploading files and size limits, one of the fastest solutions is to reach out to your host and ask for help. Many hosting companies have chat support which can help you out quickly in these situations. Increasing an upload limit is a trivial task for a tech support person, and they should be able to do it within a minute.

If you are a Kinsta client, the knowledgeable support team is always a click away on the bottom right side of the dashboard and available 24×7 if you need help. And don’t forget we have representatives in to assist you in both English and Spanish.

Send WordPress support ticket

Send WordPress support ticket

Modify Server Settings

There are a lot of server settings that affect how uploads are handled in WordPress. Regretfully, many tutorials get this wrong because they change more settings than necessary. According to the PHP Documentation, the three directives that matter are:

  • post_max_size
  • upload_max_filesize
  • memory_limit

The documentation also gives us pretty clear guidelines on how they should be set up:

[post_max_size] sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.

We’ll need to set these three up to accommodate for our file sizes. If the largest file will be about 10 MB, we would recommend setting the upload_max_filesize to 12M (12 MB), the post_max_size to 13M and the memory_limit to 15M. Notice, they use M instead of MB. Uploads can contain a fair bit of text information in addition to the file itself so giving everything some breathing space is a good idea.

Now that we know what to modify, we just need to know how. There are five things you can try. Some of these may not work for you, depending on your server setup.

Option 1 – Change PHP Options in cPanel

If you are running on a host that uses cPanel, you can easily change this from the UI. Under Software click on “Select PHP Version.”

select php version

Select PHP version in cPanel

Click on “Switch to PHP Options.”

switch to php options

Switch to PHP options

You can then click on each property and change its value. Then click on “Save.”

increase maximum file upload size in cpanel

Increase maximum file upload size in cPanel

Option 2 – Create Or Modify php.ini Files

By default, php.ini files are the ones that govern how your server is set up. Due to restrictions in servers, you may not be able to use php.ini files, which is why the .htaccess method works more consistently, we’ll take a look at that next. To edit your php.ini file, login to your site via FTP or SSH, go to your site’s root directory and open or create a php.ini file.

php.ini file

php.ini file

If the file was already there, search for the three settings and modify them if necessary. If you just created the file, or the settings are nowhere to be found you can paste the code below. You can modify of course the values to meet your needs.

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

Some shared hosts might also require that you add the suPHP directive in your .htaccess file for the above php.ini file settings to work. To do this, edit your .htaccess file, also located at the root of your site, and add the following code towards the top of the file:

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

Option 3 – Modify php.ini File in cPanel

If you’re using cPanel, modifying the php.ini file can also sometimes be done via the MultiPHP INI Editor tool. Under Software click on “MultiPHP INI Editor.”

MultiPHP INI Editor

MultiPHP INI Editor

Select your home directory (domain root) from the drop-down.

MultiPHP INI Editor home directory

MultiPHP INI Editor home directory

Change the value of upload_max_filesize to something larger.

MultiPHP INI Editor upload_max_filesize

MultiPHP INI Editor upload_max_filesize

Option 4 – Create Or Modify .user.ini Files

If the above didn’t work for you, it could be that your host has the global settings locked down and instead have it configured to utilize .user.ini files. To edit your .user.ini file, login to your site via FTP or SSH, go to your site’s root directory and open or create a .user.ini file. You can then paste in the following code:

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

Option 5 – Create Or Modify .htaccess Files

The .htaccess file is a special hidden file that contains various settings you can use to modify the server behavior, right down to a directory specific level. If the php.ini method above didn’t work, we suggest you try this next. First of all, login to your site via FTP or SSH, take a look at your root directory and see if there is a .htaccess file there.

.htaccess file

.htaccess file

If there is you can edit that file to add the necessary code for increasing the upload limit.

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

If you get an “internal server error” message with the method above it is most likely your server is running PHP in “CGI mode,” which means you can’t use the above commands in your .htaccess file.

internal server error

Internal server error

Option 6 – Use The ini_set() PHP Function

The last option is not one we are fans of, but if all else fails you can give it a go. First, login to your site via FTP or SSH, and locate your wp-config.php file, which is typically in the root of your site.

wp-config.php file

wp-config.php file

Add the following code to the wp-config.php file:

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

In theory, you could try adding it to your theme’s functions file or your plugins main file, but this code really has no place in either. As a last resort or an interim solution, it could work though.


NGINX is an alternative web server software to good old Apache. It can be a lot faster than Apache which is why we use is on all of our servers here at Kinsta. If you are running your website on NGINX you’ll need to change your php.ini file as well as your NGINX config file.

We’ve already discussed how to modify a php.ini file so all we need is the code for the NGINX config:

Tired of WordPress hosting support that seems to know less than you do?

We understand! That’s why Kinsta only employs high-skilled developers and Linux Engineers. The expertise of our support department is second to none, and we’re available 24x7 to help!
http {
        client_max_body_size 13m;

Note that you’ll have a number of settings within the HTTP group. Only change the client_max_body_size parameter to make sure you don’t modify anything unintentionally. Last but not least, you’ll need to reload some services to make sure the changes are applied. Issue the following commands and you should be all done:

service php5-fpm restart
service nginx reload 

If you are a Kinsta client, you don’t have access to your NGINX config. So feel free to reach out to our support team and they can quickly make the changes for you.

Utilize the WordPress upload_size_limit Filter

Another alternative way to increase the upload file size is to utilize the upload_size_limit filter which was introduced in WordPress 2.5. Below is an example of the code from Drew 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 );

Double Checking the Maximum Upload File Size

Checking if the above solutions worked is pretty easy. We like to go to the Media section and click on Add New. You should see a little message that says: “Maximum upload file size: 25 MB” for example. The numeric value should change as you modify the settings. As the beginning, we started with a 5 MB upload file size limit and as you can see below, we have now increased it to a 25 MB limit.

checking maximum upload file size in wordpress

Checking maximum upload file size in WordPress

If you made changes to multiple places, we recommend going step-by-step and undo any changes that didn’t work. Both the .htaccess file and php.ini file are similar to the cascading properties of CSS. The post_max_size set in a child directory overwrites the same directive from a parent directory. This can lead to a lot of confusion if you’ve defined these directives everywhere in an attempt to “make sure it works”.

Alternative Option – Upload Files Via FTP

If you are struggling with your current host on getting your limits raised, you always have the option to upload your large files via FTP (SFTP) and then utilize the free Add From Server plugin. If you have a lot of large files, this is actually a faster method. Check out our in-depth tutorial on how to bulk upload files to WordPress media library via FTP.


As you can see, increasing the WordPress maximum upload file size isn’t too complex, it’s just a matter of knowing where to look and which commands to use. Hopefully, now you understand a little better on how to change and adjust the settings for your WordPress site. If you’ve had a particularly stubborn case of file size limits being stuck let us know how you managed to fix it, as each host and server can be set up differently.

If you enjoyed this article, then you'll love Kinsta's WordPress hosting platform. Whether it's speeding up your website or getting 24x7 support from our veteran WordPress team, we're here to help your business succeed. Our Google Cloud powered infrastructure focuses on auto-scaling, performance, and security. Let us show you the Kinsta difference! Check out our features

Hand-picked related articles

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.
  1. Gravatar for this comment's author
    Owlsyard September 3, 2015 at 7:03 am

    excellent solution… I also had exactly same problem but fixed it using another way.
    Here is it –
    Go to libexternalfile_uploader.php

    Line 65 var $sizeLimit = 10485760;

    Line 68 function __construct(array $allowedExtensions = array(), $sizeLimit = 10485760){
    just change the limit. to avoid errors

  2. Gravatar for this comment's author
    zebercetadim October 23, 2015 at 8:17 am

    this is unneccesary plug in. you can adjust from cpanel upload max size as well.

  3. Gravatar for this comment's author
    Social Share June 16, 2017 at 4:29 pm

    Thank you for posting – but nothing worked. I even spent 2 hours on phone with Bluehost changing php.ini files and the like and STILL can’t upload a file over 64.

    1. Gravatar for this comment's author
      Brian Jackson June 20, 2017 at 9:28 am

      Sorry to hear that. I know Bluehost has a 50 MB maximum file size restriction by default. You need to set your PHP version first and then edit your php.ini file to be able to raise this limit.

      1. Gravatar for this comment's author
        Social Share June 20, 2017 at 11:37 am

        Hi Brian, thanks for reply. Actually my default size is 64. We did change php version before ini file – still didn’t work. Tried several other file changes as well. I ended up giving up and compressing the video file – then uploading.

  4. Gravatar for this comment's author
    Marie Judith June 28, 2017 at 3:58 am

    Option 1 worked like a charm. I have no knowledge with coding, I’ve tried several options I found online, but this was what worked so far. Thanks!

    1. Gravatar for this comment's author
      Brian Jackson July 14, 2017 at 9:01 am

      Great, glad you got it figured out!

  5. Gravatar for this comment's author
    Nagarjuna Konduri July 14, 2017 at 9:00 am

    You’re awesome, I’ve found Many forums with this subject,but no one explain like you ,Thankyou

    1. Gravatar for this comment's author
      Brian Jackson July 14, 2017 at 9:01 am

      Thanks! Glad it was easy to understand.

  6. Gravatar for this comment's author
    Holly Jo September 2, 2017 at 12:05 am

    Thank you so much. After asking multiple ‘techie people’ (which I am not!), then trying multiple methods from some of the most well-known sites out there, and getting nowhere… I finally found the answer in this post. Awesome!

    1. Gravatar for this comment's author
      Brian Jackson September 3, 2017 at 10:25 pm

      Awesome, glad it was helpful Holly!

  7. Gravatar for this comment's author
    Kobbycool October 20, 2017 at 10:21 am

    You didn’t specify exactly where we should put the code in the wp-config file…I pasted mine above “/* That’s all, stop editing! Happy blogging. */ ” But it didn’t work…

  8. Gravatar for this comment's author
    Θανάσης November 1, 2017 at 2:51 am

    Thank you Daniel. Worked on my issue. ;)

  9. Gravatar for this comment's author
    Visualmodo WordPress Themes November 5, 2017 at 11:49 pm

    Very complete and useful guide! sometime a low file_size max upload give problems while plugins uploads.

  10. Gravatar for this comment's author
    Elisabeth November 21, 2017 at 3:42 am

    Thanks for covering this in so much detail! Your post was also the only one to ask whether the problem occurs in a multisite environment…

    Which was the case for me and it was the essential information.
    I had completely overlooked that in the network settings there is the option to set an upload limit.
    The default setting was 1500 KB. Which certainly was a bit slim. :O

  11. Gravatar for this comment's author
    vee December 28, 2017 at 12:20 am

    No one talk about `upload_size_limit` filter.

    1. Gravatar for this comment's author
      Brian Jackson January 16, 2018 at 10:38 pm

      Thanks Vee! We’ve added the upload_size_limit filter example to the post.

  12. Gravatar for this comment's author
    Heena Misha December 29, 2017 at 11:38 am

    It’s amazing bro really i use VPS server. I used these all tricks but still the all not working then i found your website and use (.user.ini) and it’s working fine. Thanks a lot.

  13. Gravatar for this comment's author
    Momodu Oladapo Ibraheem January 25, 2018 at 6:57 am

    Using the cpanel option worked fine for me when all others never worked. You Rock.

    1. Gravatar for this comment's author
      Brian Jackson January 25, 2018 at 5:01 pm

      Great, glad the cPanel option worked for you.

  14. Gravatar for this comment's author
    arshpreet February 5, 2018 at 6:45 am

    Thanks a lot. You are great.. this really solved my problem I was trying to find the solution for almost last two days

  15. Gravatar for this comment's author
    Collin March 8, 2018 at 7:32 am

    Thank you very much! cPanel editing worked like a charm.

  16. Gravatar for this comment's author
    Thomas Peri March 21, 2018 at 8:28 am

    Off-topic nit-pick:

    There are two numbers “60 MB” can mean:
    (a) 60 * 1024 * 1024 = 62914560
    (b) 60 * 1000 * 1000 = 60000000

    The number in `filter_site_upload_size_limit` is neither:
    6024 * 10000 = 60240000

    1. Gravatar for this comment's author
      Brian Jackson March 21, 2018 at 8:56 am

      Hey Thomas! We love nit-pick comments because they help us improve the article. You are correct, the current math while it would have worked, was technically wrong. We have updated to (a) 60 * 1024 * 1024 = 62914560. Thanks!

  17. Gravatar for this comment's author
    Mike April 8, 2018 at 11:47 am

    Lovely. Been round in circles for hours – using the ‘select PHP version’ method worked a treat, thank you!

  18. Gravatar for this comment's author
    Simon April 16, 2018 at 5:54 am

    You saved my life!

  19. Gravatar for this comment's author
    Waqar April 18, 2018 at 10:20 am

    The best guide i found on internet about size change ….Thank You very much

  20. Gravatar for this comment's author
    Mark May 31, 2018 at 5:27 pm

    Your write-up is very comprehensive and leaves most others in the dust!
    InMotion looks a little different, here the solution lies in the multi_php.ini settings within the cPanel.

    1. Gravatar for this comment's author
      Brian Jackson June 1, 2018 at 1:49 pm

      Hey Mark!
      Thanks for the comment. We have now added the MultiPHP INI Editor tool in cPanel as another option above.

  21. Gravatar for this comment's author
    David June 4, 2018 at 10:08 am


  22. Gravatar for this comment's author
    Martin Wanjohi August 25, 2018 at 6:12 am

    Very helpful content. Thank you it helped me fix my clients upload limit.

  23. Gravatar for this comment's author
    niecey September 15, 2018 at 11:23 am

    OMG! Thank you so much for this quick walk through! I just saved alot of money… someone told me I needed to buy an SSL Cert to fix the issue and I decided to get online and up comes your article!

Leave a Reply

Use WordPress?

Use WordPress?

Join 20,000+ others who get our FREE weekly newsletter with WordPress tips on how to drive more traffic and revenue to your business!


You have Successfully Subscribed!

Send this to a friend