1. Home
  2. WordPress Tutorials
  3. How to Increase WordPress Upload Limit and Why

How to Increase WordPress Upload Limit and Why

A lot of website owners will use WordPress to collect documents or allow users to otherwise upload files. This can be useful in the business dynamic or if you have a team of WordPress users.

However, what if you want to limit the size of these files? After all, you don’t want your site to become cluttered with large files taking up drive space.

In this article, we’re going to show you a few different ways to set your WordPress upload limit. This can help you keep the folders clean and the drive space clear of debris.

Why should you limit the amount of space for an upload?

Limiting the size of uploads from users can have a variety of uses for just about any kind of a website. Whether you’re using WordPress as the backbone of your business or hosting a social community site, keeping the files low can have great benefits.

Limit Huge Image Files

One of the most common things sent to a WordPress website is imagery. Pictures can quickly flood a media folder whether you’re using them for featured posts or creating icons to be used on the site. Unfortunately, many people don’t take the time to optimize these graphics.

An image directly from a camera can be in excess of 20MB of file size. This is an incredibly large file and would take much longer to render on a website. By keeping the quota low, you can ensure users are optimizing their graphics to be used online.

Keeping Risks from Executable Software Low

Large files can house a myriad of dangerous elements. For instance, that seemingly safe text document that a user is uploading may be riddled with a virus application waiting for someone to access it. Although many pieces of malware are relatively small, keeping file transfers low can still reduce the risk to your site and your users.

Improving Website Bandwidth

Reducing the quota can impact the amount of bandwidth on your website as well. If too many people are sending large files to the site at once, these uploads can reduce performance. This means everyone accessing your webpages will be affected by large file transfers.

Improper Sharing of Large Files

Keeping a WordPress upload limit will keep users from sharing things that are too large to be on the network. For instance, music and videos can take up a great deal of space. This may also help avoid any legal issues in terms of sharing copyright materials.

Reducing Drive Space Costs

Some hosting accounts rely on a specific size of online drive space for the website. Keeping files to a minimum helps ensure that the site isn’t sacrificing its own functionality for the sake of file sharing. It may also reduce extra costs from the hosting company.

Using a Plugin to Control Upload Limits

Plugins are the bread and butter of WordPress. You can almost find a plugin to do just about anything in the popular management system. In this tutorial, we’re going to demonstrate the plugin, “Upload Quota per User.”

This is an easy-to-use addition that gives you basic control over which roles have limited access to your media folder.

To use this plugin:

Step 1: Go to “Plugins” from your WordPress admin panel on the left.

Step 2: Add a new plugin and search for, “Upload Quota per User.”

Step 3: After you install and activate the plugin, a new feature will be included in Media.

Step 4: When you click Media to expand its functions, you’ll see one labeled, “Upload Quota.” Click this to open the plugin’s settings.

NOTE: You will also notice that a new statistic will show in the Media area displaying the percentage of disk space that is currently being used according to the quota.

Step 5: Set the number of megabytes that is going to be dedicated to the media folder. For those who have unlimited hosting accounts, this can be nearly any number you will realistically use. Otherwise, keep it to a small section if possible.

Step 6: Next, set the size of a single file upload. By default, this may be set to 10. It may be more realistic if you keep this file size to 2MB or smaller. Most images for a website will be well under one megabyte, but this gives you room in case you want to display video or hold large documents.

Step 7: Set the users who are not affected by the restriction. For example, you can set the Administrator in this section to be unaffected by the upload limit. Hold down control, or command on Mac computers, to select all that apply. This may also include any custom user roles you have assigned in WordPress.

OPTIONAL: Set any compatibility types to ignore this limit if you need.

Step 8: Click “Save Changes” on the bottom left.

Now, your WordPress website will restrict the size of uploads to the media folder for those selected roles. Bear in mind that your limits may be modified because of disk space restrictions according to your hosting account. This method may also be unavailable if you’re using a WordPress.com website.

Using Code in the Theme Functions File

WARNING: Always save a backup copy of any file before making modifications. In the event of a problem, it will help you recover.

Although a plugin would be much easier to incorporate, some people like to have that hands-on approach. In some instances, you may be able to add coding to your theme’s functions.php file. To do this:

Step 1: Open your favorite FTP application or access cPanel’s File Manager in order to access your theme’s folder.

Step 2: Find the functions.php file and add the following code:

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

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

@ini_set( ‘max_execution_time’, ‘300’ );

This sets the max size to 32 megabytes. You can change this to be larger or smaller depending on your needs.

Step 3: Save the file.

Not all themes will support this function. You will also want to keep in mind that if the theme is automatically updated at a later time, this code will be erased. It’s better if you make alterations like this in a child theme.

Using Code in the .htaccess File

Some users may be able to alter the .htaccess file of their site to change upload quotas. While this may not work for everyone, it may be worth a try to keep your file sizes low. To modify the .htaccess file:

Step 1: Use FTP or cPanel’s File Manager to access the root folder of your website.

Step 2: Locate and edit the .htaccess file by placing the following code:

php_value upload_max_filesize 32M

php_value post_max_size 32M

php_value max_execution_time 300

php_value max_input_time 300

Like in the example above, this limits users to 32 megabytes for uploads. You can make this smaller by putting in a lower number.

Step 3: Save the file.

Depending on the type of account you have for hosting, this may not work for limiting files sizes. However, many people have experienced success with this format.

When it comes to modifying your WordPress upload limit, you have your own limitations to consider. Not all shared hosting servers will allow such changes. If you’re having problems with your modifications, contact your hosting company to change the limits on your account.

What kind of restrictions to you place on your guests? What kind of files are uploaded to your website?

Author: Chris Racicot

Chris is the Support Manager at GreenGeeks and has been with the company since 2010. He has a passion for gaming, scripting and WordPress. When he’s not enjoying his sleep, he’s working on his guitar skills and fiddling with 3d printing.

Updated on December 15, 2017

Was this article helpful?

Related Articles

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.