Alex Williams
Alex Williams  —

Last updated:

Share this Post

WordPress Increase Upload LimitThere’s nothing more frustrating than trying to upload a file to WordPress, only to be hit with a “exceeds the maximum upload size for this site” error.

This limit essentially stops you from using fancier themes or uploading larger videos or even images that might be important for your site and what you’re trying to do.

Of course, while it might be frustrating, there’s actually a good reason for the limit: security and stability. It does so by stopping people from uploading huge files that could eat up bandwidth or slow down other users on a shared hosting plan.

Thankfully, there are some ways to get around this, up to a certain limit.


What Is The Maximum Upload Size on WordPress

So what exactly is the upload limit for WordPress? Well, truthfully that depends on the WordPress host that you end up using. In most cases, the upload size is written on the page when you try and upload a file or image. You can check that by going to Admin > Media > Add New, and it will show you the upload limit, usually at the bottom.

This upload limit usually ranges between 4MB to 128MB depending on the host. It also tends to be set in stone at the server level, so while you can do some forms of bypassing, you won’t ever be able to go above the limit set at the server level.

Also, before moving forward, we do need to clarify that if you’re using some form of shared hosting, then you probably won’t have access to the root folder. This might be problematic for some of the methods here that require root access.

Thankfully, there is an option that works without that kind of access, which you’ll find at the bottom. Failing that, you could also consider going with a dedicated host that will give you root access.

Possible Solutions:

#1 PHP.INI file

As you may have guessed, the PHP.INI file is a PHP file that sets your default PHP settings, and so may allow you to change the default upload size.

PHP.INI file1

To access this file, you’ll need root access, and the use of an SSH tunnel or an FTP (such as Filezilla). You’ll then want to locate the PHP.INI file in the root directory, although be aware that you might not have one, in which case, you can create one.

In either case, you’ll want to modify the file or put this code in when creating it:

  • ☑️ upload_max_filesize = 64M
  • ☑️ post_max_size = 64M
  • ☑️ max_execution_time = 300

If 64MB doesn’t work, you can try 10MB, that’s reported to work sometimes. Also, sometimes hosts don’t allow you access to root or this file, in which case, move on to the next method.


#2 Edit Functions.php

If you’re more comfortable working with theme files, this solution might be a bit easier.

Edit Functions.php

Just access your functions.php and add this bit of code:

  • ☑️ @ini_set( 'upload_max_size' , '64M' );
  • ☑️ @ini_set( 'post_max_size', '64M');
  • ☑️ @ini_set( 'max_execution_time', '300' );

Of course, keep in mind that if you change your theme, the limit will go back to the default one, so you’ll have to add this bit of code again.


#3 wp-config.php File

wp-config.php FileIf neither of the two options above work, you can try and change the size parameter in the wp-config.php File.

Again, use SSH or FTP to access your root folder and look for the file, then add this bit of code to it:

  • ☑️ @ini_set( 'upload_max_size' , '20M' );
  • ☑️ @ini_set( 'post_max_size', '13M');
  • ☑️ @ini_set( 'memory_limit', '15M' );

Don’t forget to save when you’re done!


#4 The user.ini File

It’s possible that your competitive host has locked the PHP settings because they’re working with user.ini files instead, in which case you’ll have to edit those.

This file usually resides in the root folder like all the others, so SSH or FTP in, and if you can’t find it you can always create a new one.

The user.ini File

Again, either modify or add this bit of code in the file:

  • ☑️ upload_max_filesize = 32M
  • ☑️ post_max_size = 64M
  • ☑️ memory_limit = 128M

This is actually a similar bit of code to the php.ini file method, but with a different file name.


#5 .htaccess Method

Again, much like the previous methods, this involves altering a file in the root directory.

.htaccess Method

Once inside root, look for a .htaccess file and modify it to add this bit of code:

  • ☑️ php_value upload_max_filesize 64M
  • ☑️ php_value post_max_size 64M
  • ☑️ php_value max_execution_time 300
  • ☑️ php_value max_input_time 300

#6 Using a Plugin

plugin iconsIf you aren’t comfortable using code or messing around with FTPs, SSH, and root access, there’s always the option to use a plugin.

This will cut out A TON of extra work for you to do, although you don’t always have as much granular control over things. Nonetheless, it’s still something to try out if other options don’t work as well.

In terms of which plugins to use, there are several options, but WP Increase Upload Filesize and Increase Maximum Upload File Size are two popular ones.

Whichever plugin you use, the process is essentially the same: Install the plugin on your site and then go to the settings screen. If you used WP Increase Upload Filesize then you’ll see two numbers: the upload limit set by the host, and your current upload limit set by WordPress.

If the WordPress limit is lower than the host limit, then crank it up to max (or whatever size you prefer).

Again, keep in mind that you can’t go above the server level limit set by the host. To do that, you’ll have to contact the host directly and see if they’re willing to do the change and how much it will cost you.

You Might Also Like: