Skip to content Skip to sidebar Skip to footer

How to Increase Upload & Download Speeds

A depression WordPress upload size limit stops you from uploading big files, plugins, and themes. If you're edifice a media-heavy website, that tin be a considerable obstacle. It's necessary to increase the max upload size in WordPress or your server (or both) in such cases.

Depending on your hosting provider and server, in that location are many ways to become well-nigh solving this issue. We'll cover them all in this article and show you how to increase the maximum upload size in WordPress quickly.

Let's swoop in!

Prefer to lookout man the video version?

What Is the Maximum Upload Size in WordPress?

Uploading large files to a server consumes a lot of the server'south resources. To prevent users from causing server timeouts, the default maximum upload size in WordPress typically ranges from four MB to 128 MB. Usually, the hosting provider sets this limit at the server level.

WordPress also includes constants that ascertain this limit, but they cannot override the server-level settings in most cases.

To verify this, go to your WordPress site's Media Library. Here, try to upload a file that crosses this maximum upload file size limit. You'll run across an error bulletin that looks something like this:

Error while uploading a large file in WordPress
Error while uploading a big file in WordPress

The "exceeds the maximum upload size for this site" mistake can be frustrating, but information technology exists for two main reasons: security and efficiency. Information technology hinders site owners and other users, including malicious actors, from uploading huge files (due east.g. high-resolution images, big videos).

Otherwise, it can result in incapacitating your website'due south server, making your site come to a clamber. Or worse, it can bring your site downwards altogether!

Want to upload a large file, plugin, or theme... but express by the max upload size?🗂 Learn how to resolve this common consequence quickly & easily right here ⬇️ Click to Tweet

How to Cheque the Electric current Maximum Upload Size in WordPress

There are many means to check your WordPress site's electric current max upload size. Let's go through all of them.

In the Media Library

The quickest mode to bank check your site'south current maximum upload size is to become to your WordPress dashboard, and from at that place, go to Media > Library. Here, click on the Add New button to actuate the media uploader tool.

The "Maximum upload size limit" in WordPress
The "Maximum upload size limit" in WordPress

As Kinsta hosts this site, the Maximum upload file size: 128 MB. bulletin displays below the Select Files push. If you lot're using a different spider web hosting provider, yous may see a dissimilar limit listed hither.

Y'all tin besides go to Media > Add together New directly and see the same message displayed at the bottom.

The
The "Maximum upload file size" in WordPress' Media Library

Again, y'all tin can see the 128 MB max upload file size here.

In the Site Health Info

WordPress five.2 added the Site Health Info tool to help you debug your WordPress site better. Here, you tin find almost all the information about your server and WordPress configuration.

Every bit both the server and WordPress handle the max upload file size, at that place are ii ways to find its value on this screen.

First, yous tin find it listed nether the Media Handling dropdown. Hither, expect for the value of Max size of an uploaded file constant.

'Media Handling' settings in the 'Site Health Info' panel
'Media Handling' settings in the 'Site Health Info' panel

The second method is to look under the Server dropdown. Yous'll find many options related to your webserver's setup under here. Please search for the value for Upload max filesize abiding to meet what it is. On this site, the max upload file size limit is 128 MB.

'Server' settings in the 'Site Health Info' panel
'Server' settings in the 'Site Health Info' panel

You can also come across other PHP constants and their values, such equally:

  • PHP post max size: Defines the maximum upload limit for POST requests.
  • PHP memory limit: Defines the retention allocated for PHP. It should be ready equal to or college than the Upload max filesize limit. Or else the upload will fail.

Your web host sets these options. Usually, starter hosting plans will have a lesser upload size limit than enterprise hosting plans. Some hosts may allow you to override these limits. But in most cases, yous may need your hosting provider'south assistance (and possibly a plan upgrade) to increment them.

Why Increase the Maximum Upload File Size in WordPress?

There are many reasons why y'all may need to increase your WordPress site'southward maximum upload file size. Here are the about common ones:

  • You want to install a large theme or plugin directly through the WordPress admin dashboard.
  • Updating your WordPress site regularly is a great way to proceed your readers engaged and return for more. And that includes uploading new images, videos, audios, and other media regularly. Withal, that's not always feasible when there's a file size limit for your uploads.
  • You desire to upload a large video or image as your site's background or header.
  • You plan to sell digital files such as ebooks, photographs, videos, themes, and plugins direct from your site. Sometimes, these files can stitch to hundreds of megabytes (or more).

Now that nosotros've covered the basics of max upload file size in WordPress, let'southward acquire how to increase information technology.

10 Means to Increase the Max Upload File Size in WordPress

There are many ways you can fix the WordPress maximum upload size issue. We'll start with the easiest ones beginning, and then we'll move on to the intermediate-level tutorials.

Contact Your Hosting Provider for Help

If you lot're facing bug with uploading files and file size limits, reaching out to your hosting provider for assistance is one of the quickest solutions. Increasing the upload limit is a trivial task for tech back up, and so most hosting companies can assistance you gear up this effect apace.

Tinkering with your server or site configuration files can ever exist a claiming. Hence, nosotros always recommend you endeavor this method beginning.

If you're hosting your site with Kinsta, our knowledgeable back up team is just a click away and available 24/7. To get started, go to your MyKinsta dashboard and click the chat icon in the bottom correct corner.

Contact Kinsta support easily through MyKinsta
Contact Kinsta support easily through MyKinsta

Nosotros have representatives to assist you lot in many languages, including English, Castilian, French, German, Italian, and Portuguese.

Increase the Max Upload File Size in WordPress Multisite

If you lot're running a WordPress Multisite network, then yous can modify the max upload file size for your network.

Start, head to your Network Admin dashboard, and then get to Settings > Network Settings screen. Here, scroll down till you find the Upload Settings section. You'll find the Max upload file size field in this area.

The 'Max upload file size' in 'Network Settings'
The 'Max upload file size' field in 'Network Settings'

The default value of Max upload file size in a WordPress Multisite is 1500 KB (~1.v MB). You can alter this to a college value and click the Save Changes button.

Annotation: Y'all cannot circumvent the server-level max upload size limit from here. If the limit you set here is higher than the server'due south max upload size limit, the server will ignore it. You tin utilize the methods described above to detect your webserver'southward configuration.

The new 'Max upload file size' field in 'Network Settings'
The new 'Max upload file size' in 'Network Settings'

Here, we've set the new max upload file size to 131072 KB (~128 MB).

You tin can also limit the total size of files uploaded to an individual site in the Multisite network. However, it's disabled by default.

Update Your '.htaccess' File

If your webserver runs on Apache, y'all can update your site's .htaccess file to increase the max upload size in WordPress. You lot can find your .htaccess file in the WordPress site'south root directory.

As per PHP documentation, three PHP directives are responsible for how WordPress handles uploads. They are:

  • upload_max_filesize
  • post_max_size
  • memory_limit

We've already discussed them in the Site Wellness Info section above. It would assistance if you modified these three directives' values to admit your file sizes. For instance, if the largest file you're planning to upload is 32 MB, nosotros recommend the following settings:

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

Notice, all the values use M instead of MB. That'southward how PHP handles its directives.

Uploads tin contain extra data in add-on to the file itself. So, giving all other upload-related directives some breathing space is a good idea. You can read our in-depth tutorial on how to improve PHP memory limit in WordPress for more data.

Access your .htaccess file via FTP/SFTP or your hosting provider'due south File Managing director.

Finding the '.htaccess' file
Finding the '.htaccess' file

Open up the.htaccess file with a text editor or lawmaking editor, and then add the following code:

          php_value upload_max_filesize 32M php_value post_max_size 64M php_value memory_limit 128M php_value max_execution_time 300 php_value max_input_time 300        

You lot tin can notice two other PHP directives in the above lawmaking: max_execution_time and max_input_time . They define how long a server spends on a unmarried PHP task. The bigger your uploads, the bigger the fourth dimension spent volition be. You lot need to ready their values to a number that's appropriate for your use case.

Note: Y'all may get a 500 Internal Server Error after using the method higher up. Most likely, information technology'due south considering your server is running PHP in CGI mode. In such cases, y'all cannot use the above commands in your .htaccess file.

Create or Modify the 'php.ini' File

The php.ini file is where you define changes to your default PHP settings. Typically, it contains directives that ascertain file timeouts, max upload size, and resources limits.

Using SSH or FTP, you can find the php.ini file in your WordPress root directory. In some cases, y'all may not locate it there. Fret not! Yous tin create a new file with the same name in your site's root directory.

How to create a new php.ini file
How to create a new php.ini file

With a lawmaking or text editor, add the post-obit code to your existing or new php.ini file:

          upload_max_filesize = 32M post_max_size = 64M memory_limit = 128M        

Don't forget to save your file afterward making the changes. Some hosts don't permit you lot to change PHP settings via this method. In such a instance, yous can proceed to try the following solution instead.

Subscribe Now

Create or Modify the '.user.ini' File

If your hosting provider has locked down the global PHP settings, they may have configured the server to piece of work with .user.ini files instead of php.ini files.

Like php.ini and .htaccess files, you tin can find the .user.ini in your site'southward root directory. If you can't find information technology, then y'all can create a new .user.ini file in the same location. Follow the same procedure described in the previous method to create a newphp.ini file.

Adjacent, add the following lawmaking to your .user.ini file:

          upload_max_filesize = 32M post_max_size = 64M memory_limit = 128M        

Yous'll notice that it's a repeat of the previous method, except with a dissimilar filename.

Change PHP Options via cPanel

If your hosting provider uses the cPanel dashboard to help you lot manage your server and site configuration, you tin can alter the max upload file size through its interface.

To get started, go to your cPanel dashboard, and select the Select PHP Version under the Software department.

Click 'Select PHP Version' in cPanel dashboard
Click 'Select PHP Version' in the cPanel dashboard

Here, you lot tin modify your server'southward current PHP version and enable/disable many PHP extensions. Click on the Options link in the navigation menu to go to the PHP Options console.

Go to the 'PHP Options' settings in cPanel
Go to the 'PHP Options' settings in cPanel

Scroll down here to modify the values of PHP directives such as upload_max_filesize , post_max_size , memory_limit , max_execution_time , and max_input_time . The max values y'all can set hither depend on your current hosting plan.

The 'PHP Options' screen in cPanel
The 'PHP Options' screen in cPanel

If you have whatever doubts about these values, nosotros suggest y'all contact your hosting provider. The latest cPanel dashboard saves changes automatically, then you don't take to click anything. Only if you're using an older cPanel version, make sure to click the Save Changes button.

Increment the Max Upload File Size in Nginx

Nginx is another webserver like Apache, but it'south also a lot more. Typically, Nginx can handle more concurrent requests than Apache, making it a lot faster. Kinsta uses Nginx to power its performance-optimized hosting solutions for WordPress.

If you lot're running your WordPress site on Nginx, you'll need to modify both your php.ini and nginx.conf files. We've dealt with the former file before. The latter one is chosen an Nginx config file.

On an Nginx server, you can find the php.ini file at /etc/php/7.4/fpm/php.ini . Depending on which PHP version you've installed, the exact path may vary slightly.

          upload_max_filesize = 64M post_max_size = 128M        

You don't take to set the memory_limit in the to a higher place file as Nginx handles it differently. For more, y'all tin cheque out this Stack Overflow thread. Subsequently saving your php.ini file, enable the changes by restarting PHP-FPM using the below code in your terminal:

          sudo service php7.4-fpm restart        

Again, the exact code may vary slightly depending on the PHP version installed on your server.

Side by side, apply Nginx'southward client_max_body_size directive to prepare the new max upload size limit. Yous demand to declare this directive in the nginx.conf file, which yous can find at /etc/nginx/nginx.conf .

You can declare this directive inside the http {...} block, the server {...} cake, or the location {...} block.

Setting it in the http block will affect all the sites/apps hosted on this server.

          http {     ...     client_max_body_size 128M; }        

Defining information technology in the server block will only affect a specific site/app hosted by this server.

          server {     ...     client_max_body_size 128M; }        

The location block merely affects the specified directory (due east.g. files, uploads) within a site/app.

          location /files {     ...     client_max_body_size 128M; }        

Don't forget to save the file and restart Nginx to apply the changes. To do that, you tin utilise the following command in your concluding:

          sudo service nginx reload        

If you're a Kinsta client, you lot tin can't access your Nginx config directly. Withal, you can accomplish out to our support team, and they can quickly make the changes for you.

Use the WordPress 'upload_size_limit' Filter

WordPress 2.5 introduced the upload_size_limit filter, which filters the maximum upload size allowed in php.ini. Even WordPress uses this filter to show yous the max upload size immune, like in the Media Library and Site Health Info screens.

Below is an example of this filter in activity from WordPress contributor Drew Jaynes. It defines the upload size limit for all non-admin roles.

          /** * Filter the upload size limit for non-administrators. * * @param cord $size Upload size limit (in bytes). * @return int (maybe) Filtered size limit. */ office filter_site_upload_size_limit( $size ) { // Ready the upload size limit to 10 MB for users lacking the 'manage_options' capability. if ( ! current_user_can( 'manage_options' ) ) { // 10 MB. $size = 1024 * 10000; } render $size; } add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 20 );        

The higher up code uses WordPress' manage_options adequacy to set this limit but for non-admins. You can modify the code to target specific user roles or user ids. Read our in-depth WordPress roles and capabilities commodity for more information.

Use a WordPress Plugin

Messing with lawmaking using SSH or FTP/SFTP is not for anybody. If you're non comfortable with writing or editing lawmaking, you can use a WordPress plugin instead.

WP Maximum Upload File Size plugin
WP Maximum Upload File Size plugin

We'll exist using the WP Maximum Upload File Size plugin here. As of writing this, it'due south the only up-to-date plugin on the WordPress plugin repository that helps yous get this done.

To get started, install and activate the WP Maximum Upload File Size plugin. Next, go to its settings screen in your WordPress dashboard. Hither, y'all tin can meet the maximum upload file size set up by both your hosting provider and WordPress.

WP Maximum Upload File Size settings screen
WP Maximum Upload File Size settings screen

Here, y'all can come across that the maximum upload file size set by WordPress is lesser than that fix by your hosting provider. Hence, yous can crank it up by choosing the Maximum Upload File Size with the dropdown presented.

Annotation: If you want to set a max upload file size limit that's larger than the one set up by your hosting provider, it'southward non possible to do information technology via this plugin. For that, you lot demand to contact your hosting provider.

Upload Files via FTP/SFTP

Are you lot however struggling with all the to a higher place methods? Or with your hosting provider to have them enhance the upload file size limit? You tin can always upload large files via FTP/SFTP.

FileZilla window with a site connected
Drag and drop files to and for your server and computer with SFTP

If you take a lot of large files to upload, this is the fastest method. You tin read our in-depth tutorial on how to bulk upload files to the WordPress media library for more information.

Sometimes, WordPress doesn't recognize files uploaded via FTP/SFTP. If that'due south the case, you tin utilize the free Add From Server plugin to import the uploaded files into WordPress.

Alternatively, you tin do the same straight from the control line past importing images using WP-CLI. The wp media import command allows you to create attachments from local files or URLs.

Don't Edit the 'wp-config.php' File

Editing the wp-config.php file doesn't work anymore. We're adding it here because we've found many web tutorials that list information technology as a legitimate mode to increase the max upload size in WordPress.

It involves going to your site's root directory via FTP/SFTP or SSH and and so editing the wp-config.php file.

Finding the 'wp-config.php' file
Finding the 'wp-config.php' file

You're suggested to add together the following code to the wp-config.php file:

          @ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '128M'); @ini_set( 'memory_limit', '256M' );        

Information technology fails to work because y'all tin only employ the ini_set() function to set PHP directives that belong to the PHP_INI_ALL changeable fashion.

As upload_max_size and post_max_size vest to the PHP_INI_PERDIR changeable mode. You tin can simply fix them via php.ini, .htaccess, http.conf, or .user.ini.

If you've tried this method before without seeing whatever results, now you lot know why it fails.

Verify Your WordPress Site's New Max Upload File Size

Finally, it's fourth dimension to verify whether the new max upload file size limit is implemented in your WordPress site. To do this, follow the same procedure we discussed higher up to cheque the max upload file size in WordPress.

Go to your Media Library in the WordPress dashboard and check whether the max upload file size limit has changed.

Verifying the new max upload file size limit
Verifying the new max upload file size in 'Media Library'

Yes, information technology has inverse. That's a success!

You can also go to the Site Health Info console and check for the same under Media Treatment and Server dropdowns.

Verifying the new max upload file size limit in 'Site Health Info'
Verifying the new max upload file size in 'Site Wellness Info > Media Library'
Verifying the new max upload file size limit in 'Site Health Info'
Verifying the new max upload file size in 'Site Health Info > Server'

Don't let the maximum upload size in WordPress concur you dorsum! 🙅‍♂️ This guide volition show you how y'all tin can easily increase the limit to accommodate your larger files 👇 Click to Tweet

Summary

Every bit you lot've seen, increasing the maximum upload file size in WordPress isn't too circuitous. Whether y'all're building a media-heavy portfolio site or installing a big theme, it'southward merely a thing of knowing where to wait for and what commands or tools to utilize.

In most cases, reaching out to your hosting provider should be enough. However, if you lot're stuck with a troublesome host, nosotros've shown you some alternative methods you tin can try earlier migrating to better hosting.

Get uploading!

Did we cover it all? If you've experienced a stubborn case of upload file size limits, let us know how you managed to gear up it.


Save time, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/seven.
  • Cloudflare Enterprise integration.
  • Global audition reach with 29 data centers worldwide.
  • Optimization with our congenital-in Application Performance Monitoring.

All of that and much more, in i plan with no long-term contracts, assisted migrations, and a 30-day-money-dorsum-guarantee. Cheque out our plans or talk to sales to discover the plan that's right for you.

fergusoninny2000.blogspot.com

Source: https://kinsta.com/blog/increase-max-upload-size-wordpress/

Post a Comment for "How to Increase Upload & Download Speeds"