10 Ways to Increase the WordPress Maximum Upload File Size

One of the first things you unhappily discovered on your new WordPress website is that there’s a limit to the size of the files you can upload. Especially if you were excited to spice your website up with some hefty media files, you were probably left disheartened to learn that the file exceeded the maximum upload size.

This is what happened when we tried to upload Pixie’s Hey cover from my college band. WordPress said no, or in its own words, hey.MOV exceeds the maximum upload size for this site.

WordPress accounts have a maximum upload file size, and won’t allow you to upload files that exceed it

The restriction on upload file size can come from several places – but it’s most likely related to the default limit set by your host. While the issue can be frustrating, there’s an easy way to fix it. In other words, there are tricks to increasing the maximum upload file size on your WordPress account, and we’ll teach you how to do it!

Here’s an overview of the steps you can take to increase the maximum upload file size on your WordPress:

  • Increase the Maximum Upload File Size in Multisite
  • Change the Settings in cPanel
  • Change the Settings in Your .htaccess File
  • Change the Settings in Your php.ini File
  • Changing the php.ini File On NGINX
  • Change the Settings in Your .user.ini File
  • Change the Settings in Your wp-config.php File
  • Change the Settings in Your Theme or Plugins Main File
  • Try Using a Plugin
  • Contact Your Web Hosting Provider.

Keep in mind that if you don’t want to go through the hassle of manually adjusting the code, or if you’re certain that the limit is restricted by your web host, you can just skip to the last step and directly contact your web hosting provider. Their tech support should solve the issue for you in no time!

Let’s first look at what causes this issue, and then what you can do to manually increase the maximum upload file size for your WordPress website. After all, the world should be exposed to our college band’s Hey cover.

Why Is My Upload File Size Limited?

The upload file size limitation is generally set by your host. Most hosts will keep the limit low by default, so it’s the server itself that is set to restrict the size of the files. Depending on the default settings of your web host, the maximum upload size in your WordPress can range from 2MB to 150MB.

This means that usually, the upload file size limitation is not related to WordPress, so – sadly – you probably won’t be able to get it fixed through WordPress.

The reason why hosts limit the upload file size has to do with security and efficiency. If too many websites are uploading files that are too large, there’s a good chance that:

  • Your website will load slowly.
  • Too many websites with large files can cause issues with the server, even to the point of it crashing.

In fact, you shouldn’t be uploading media files that are too large, anyway. They will mess up your website’s loading speed and decrease your SEO rankings. (You can check out how to optimize images for web and performance right here.)

While that makes sense, a maximum upload file size of 2MB is practically nothing. If you want to add some color to your website, a 2MB limit will allow you to maybe add a low-quality, pixelated, B&W image, and have to call it a day. And that just won’t do.

Before we get started on how you can increase the WordPress maximum upload file size, you can check the limit on your own WordPress account and see what you’re working with.

To do this, open your WordPress website, and from the admin dashboard go to Media > Add New. The window will kindly let you know what the default maximum upload file size is:

How to check the maximum upload file size on your WordPress

Not happy? Didn’t think so. Let’s look at how we can change that with a few simple solutions.

How to Increase the WordPress Maximum Upload File Size

There are a number of ways you can increase the maximum upload file size in WordPress. Let’s start with the easier options, and move onto the ones that are slightly more challenging. Keep in mind that which of these solutions you can employ depends on the WordPress and host settings.

1. Increase the Maximum Upload File Size in Multisite

Yes, we said that generally this issue can’t be fixed from WordPress – but the exception is if you’re running a multisite. Keep in mind, however, that the maximum upload file size will still be limited by your server. So if the server limit is 15MB, you won’t be able to increase the maximum upload size to something like 25MB for your multisite.

However, if your server’s upload file size limit is 20 MB, but the limit of the default network settings is 10MB, you can easily increase the maximum upload file size. To do this:

  1. Go to the WordPress admin dashboard > Network Admin > Settings.
  2. Scroll down to Max upload file size.
  3. Increase the maximum upload file size to what your server allows, so in this case, set it to 20MB, or, 20,000KB.
  4. Click on Save Changes.

That’s it!

If you need to change the server’s maximum upload size settings, keep reading.

2. Change the Settings in cPanel

If your host uses cPanel, increasing the maximum upload file size will be quite easy. Just access cPanel’s user interface, and take the following steps:

  1. Go to Software > Select PHP Version.
  2. In the top-right corner of the resulting window, select Switch to PHP Options.
  3. Change the number values of memory_limit, post_max_size, and upload_max_filesize. (Note: Rather than MB, it will say M.)
  4. Click on Save.

You should now be able to upload larger size to your WordPress website.

3. Change the Settings in Your .htaccess File

If your web server uses Apache, you can edit the PHP Apache module from the .htaccess file to increase the maximum upload file size for your WordPress website. The .htaccess file is a hidden file which contains a number of your server’s settings which you can adjust – like the maximum upload file size.

To do this:

  1. Connect to your server via FTP client.

(If you don’t know how to do this yet: open your browser or file explorer, and type in ftp://[FTP-server-IP-or-domain-name], where server IP or domain name are your server’s IP or domain name, then press Enter. Write in your username and password and select Log On to connect to your FTP server.)

  1. Navigate to the WordPress folder.
  2. From the Root directory, look for the .htaccess file. (Note: if it isn’t there, your server has limited your access and this method won’t work for you.)
  3. Open the .htaccess file in any text or code editor, like Notepad.
  4. Change the PHP values concerning maximum upload file size. For instance, you can add the following lines if the new limitations suit you:

php_value upload_max_filesize 64M

php_value post_max_size 128M

php_value memory_limit 256M

php_value max_execution_time 300

php_value max_input_time 300

You can always change the values if you want more or less file upload space. Again, M stands for MB. The execution and input time are set in seconds.

4. Change the Settings in Your php.ini File

Unless your web host has restricted your access to the server settings, you can increase the maximum upload file size on your WordPress via your php.ini file. This is the default file for configuring programs that run on PHP. To change the settings in your php.ini file:

  1. Connect to your server via FTP client.
  2. Go to the root directory and open the php.ini file. If it isn’t there, create it.
  3. If the file already existed, search for the following settings and modify them.
  4. If you created the file, open any text editor (like Notepad), and paste the following lines:

upload_max_filesize = 64M

post_max_size = 128M

memory_limit = 256M

Again, these values are just examples. You can modify them per your needs.

  1. Save the file as php.ini and upload it to your root directory.
  2. Check if it worked! Try uploading a larger file to your WordPress website. If it didn’t work, it may be because you need to edit the settings in your .htaccess file as well (this happens with shared hosts). So…
  3. Go to your .htaccess file and add these lines at the top of the file:

 

suPHP_ConfigPath /home/username/public_html

Where it says username, insert your own username.

5. Changing the php.ini File On NGINX

If your website is running on NGINX, the procedure with changing the php.ini file is slightly longer. NGINX is a great alternative server software, and is often faster than Apache. So, if your server uses NGINX, there’s an additional step when you update your php.ini file to increase the WordPress maximum upload file size.

After completing the previous steps, you need to access your NGINX config and add the following code:

http {
client_max_body_size 128m;
}

Make sure that you only adjust the settings to client_max_body_size. Accidentally changing any other settings can bring up more issues!

Lastly, you’ll need to reload some functions for the changes to take place. Copy the following commands:

service php5-fpm restart

service nginx reload 

Finally, try uploading a larger file and see if it worked!

6. Change the Settings in Your .user.ini File

If your host has limited your access to the global settings, you can try reconfiguring the settings in your .user.ini file. To increase your WordPress maximum upload file size from the .user.ini file:

  1. Connect to your server via FTP client.
  2. Go to the root directory and open the .user.ini file. If it isn’t there, create it.
  3. Copy the following lines:

upload_max_filesize = 64M

post_max_size = 128M

memory_limit = 256M

Again, adjust the values as you desire.

7. Change the Settings in Your wp-config.php File

If nothing worked so far, you can try editing the settings in the wp-config.php file. To do this:

  1. Connect to your server via FTP client.
  2. Find the wp-config.php file in your root directory.
  3. Open the file in a text editor, like Notepad.
  4. Add the following lines:

@ini_set( ‘upload_max_size’ , ’64M’ );

@ini_set( ‘post_max_size’, ‘128M’);

@ini_set( ‘memory_limit’, ‘2565M’ );

Save the changes and upload the file back to the root directory.

8. Change the Settings in Your Theme or Plugins Main File

In some cases, adding the same lines to your WordPress themes or plugins’ functions.php file can work to increase your upload file size. We don’t recommend this as a permanent solution, however, as it may cause other issues in the long run. So as a temporary measure – because you really need to upload that high-resolution photo of you doing a headstand – you can try this method.

  1. Access the functions.php file of your WordPress themes or plugins.
  2. Insert the following code:

@ini_set( ‘upload_max_size’ , ’64M’ );

@ini_set( ‘post_max_size’, ‘128M’);

@ini_set( ‘memory_limit’, ‘2565M’ );

9. Try Using a Plugin

You can try using a plugin to increase your maximum upload file size. However, this won’t work beyond the limit set by your hosting provider. So, if the case is that the default settings have a limit which is lower than the actual possible limit of upload file size, you can increase it using a plugin. However, if the maximum file size is the same as the default limit in the server settings, you won’t be able to increase the maximum upload file size with a plugin.

Let’s try it anyway.

We picked Imagify’s Increase Maximum Upload File Size plugin. This plugin automatically detects the maximum upload file size determined by your server and WordPress, and displays them for you. If you see that the limit is higher than what’s currently specified on your WordPress website, you can change it!

In some cases, you can try increasing the maximum upload file size on WordPress using a plugin

To try this method:

  1. Go to WordPress dashboard > Plugins > Add New.
  2. Search for Increase Maximum Upload File Size. Add and activate the plugin.
  3. Go to the plugin’s general settings. This is where you’ll see the maximum upload file size set by the hosting provider’s server, and find out if you can change it.

The Increase Maximum Upload File Size plugin allows you to see the limit and adjust it if you can

As you can see from this screenshot, the plugin informs us that the maximum upload file size set by the hosting provider is 64MB. So we won’t be able to increase the limit from the plugin beyond that. However, if the maximum upload file size was set to something like 16MB, you can now increase it all the way to 64MB!

  1. Click on the new limit, then select Save Changes.

10. Contact Your Web Hosting Provider

This can be the first or the last step you attempt. It’s always a good idea to contact your web hosting provider, since they can adjust your maximum upload file size for you, allowing you to focus on other aspects of your website. Let us handle the code, it’s what we’re here to do!

If you’re using DomainNameSanity, you can easily contact our team by submitting a ticket or writing an email. You’ll get a swift response and the issue will be resolved promptly.

You can get in touch with us from our website

Most of the solutions to increasing your WordPress maximum upload file size won’t work if you’re on a shared hosting package, so the best thing to do here is again to contact your web host.

Since the limit is usually set by your host’s server settings, you may find it difficult or impossible to change the settings yourself. Reaching out and asking for help is the easiest way to fix the problem. The host’s tech support will increase your WordPress maximum upload file size limit in no time!

Conclusion

In conclusion, you got this! Changing a few lines of code can go a long way in getting issues resolved, like busting that maximum upload file size limit for your WordPress website.

We hope that our guide was clear, and that you were able to change the upload file size settings with one of the solutions we provided. Contacting your web host is also a great idea, and oftentimes it can be the best way to increase the maximum upload file size for your website.

If you’re our client – or want to be – you can check out our web hosting plans for WordPress, Joomla, Drupal, and Magento hosting. Our tech support is always one click away!

View Related Articles

9 Best WordPress Security Plugins to Keep You Protected

Money doesn’t grow on trees (or at least that’s what they say). That’s why a lot of the time, we try to cut costs wherever possible. And it’s not for nothing – being smart with your spending is always a good idea. Why dough out $100 on a brand-name t-shirt when you can get the…

8 Ways to Fix ERR_TOO_MANY_REDIRECTS in WordPress

When you’re managing your own website, you’re bound to come across some glitches and errors. While some of them can get annoying, it’s kind of part of the fun of running a website. The issue is a bother, but once you fix it, don’t you feel good about yourself?…

Leave a Comment

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