A depression WordPress upload size limit stops yous from uploading large files, plugins, and themes. If yous're edifice a media-heavy website, that can be a considerable obstacle. Information technology'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, at that place are many ways to get near solving this issue. We'll cover them all in this commodity and testify you how to increase the maximum upload size in WordPress quickly.

Let's dive in!

Prefer to watch the video version?

What Is the Maximum Upload Size in WordPress?

Uploading large files to a server consumes a lot of the server's resource. 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 define this limit, just 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. Yous'll see an error bulletin that looks something like this:

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

The "exceeds the maximum upload size for this site" error can be frustrating, but it exists for two main reasons: security and efficiency. It hinders site owners and other users, including malicious actors, from uploading huge files (eastward.g. high-resolution images, large videos).

Otherwise, information technology can result in incapacitating your website's server, making your site come to a crawl. Or worse, it can bring your site downward altogether!

Want to upload a large file, plugin, or theme... simply limited past the max upload size?🗂 Larn how to resolve this common issue quickly & easily right here ⬇️ Click to Tweet

How to Check the Current Maximum Upload Size in WordPress

At that place are many ways to check your WordPress site's electric current max upload size. Permit's go through all of them.

In the Media Library

The quickest style to check your site's current maximum upload size is to go to your WordPress dashboard, and from there, go to Media > Library. Hither, click on the Add New button to activate 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. message displays below the Select Files button. If you're using a unlike web hosting provider, you may meet a dissimilar limit listed here.

You can also go to Media > Add New directly and encounter the same message displayed at the lesser.

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

Over again, y'all tin can see the 128 MB max upload file size hither.

In the Site Health Info

WordPress 5.2 added the Site Health Info tool to help you debug your WordPress site better. Here, you can find most all the information well-nigh your server and WordPress configuration.

As both the server and WordPress handle the max upload file size, there are two ways to observe its value on this screen.

First, you can find it listed under the Media Treatment dropdown. Hither, await 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 Wellness Info' panel

The second method is to look under the Server dropdown. Y'all'll observe many options related to your webserver's setup nether here. Delight search for the value for Upload max filesize constant to encounter what information technology 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 as well see other PHP constants and their values, such every bit:

  • PHP post max size: Defines the maximum upload limit for Post requests.
  • PHP retentivity limit: Defines the retentiveness allocated for PHP. Information technology should be set equal to or higher 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 let y'all to override these limits. Only in most cases, you may need your hosting provider'southward assistance (and perhaps a plan upgrade) to increase them.

Why Increment the Maximum Upload File Size in WordPress?

There are many reasons why you may demand to increase your WordPress site's maximum upload file size. Here are the near common ones:

  • You lot desire to install a large theme or plugin direct through the WordPress admin dashboard.
  • Updating your WordPress site regularly is a great mode to keep your readers engaged and render for more. And that includes uploading new images, videos, audios, and other media regularly. However, that'due south non e'er feasible when at that place'due south a file size limit for your uploads.
  • Yous want to upload a large video or image as your site's background or header.
  • Yous plan to sell digital files such as ebooks, photographs, videos, themes, and plugins directly from your site. Sometimes, these files can run up to hundreds of megabytes (or more).

At present that we've covered the basics of max upload file size in WordPress, let'south learn how to increase information technology.

10 Ways to Increment the Max Upload File Size in WordPress

In that location are many ways yous tin can set the WordPress maximum upload size issue. We'll get-go with the easiest ones showtime, and so nosotros'll move on to the intermediate-level tutorials.

Contact Your Hosting Provider for Assistance

If you're facing issues with uploading files and file size limits, reaching out to your hosting provider for assist is one of the quickest solutions. Increasing the upload limit is a trivial job for tech support, so near hosting companies can help you set up this issue apace.

Tinkering with your server or site configuration files can always exist a claiming. Hence, we always recommend you endeavour this method commencement.

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

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

We have representatives to assistance you in many languages, including English, Spanish, French, High german, Italian, and Portuguese.

Increase the Max Upload File Size in WordPress Multisite

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

First, caput to your Network Admin dashboard, and then go to Settings > Network Settings screen. Here, scroll down till yous find the Upload Settings section. You'll find the Max upload file size field in this surface 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 (~i.5 MB). Yous can change this to a higher value and click the Salve Changes push button.

Note: Y'all cannot circumvent the server-level max upload size limit from here. If the limit you lot set hither is higher than the server's max upload size limit, the server will ignore it. You can use the methods described above to find your webserver's 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 lot can likewise limit the total size of files uploaded to an private site in the Multisite network. All the same, it'southward disabled by default.

Update Your '.htaccess' File

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

As per PHP documentation, iii 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 Health Info section in a higher place. Information technology would assist if you modified these iii directives' values to admit your file sizes. For instance, if the largest file you lot're planning to upload is 32 MB, nosotros recommend the following settings:

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

Detect, all the values employ M instead of MB. That'due south how PHP handles its directives.

Uploads tin can contain actress information in addition to the file itself. So, giving all other upload-related directives some animate space is a good thought. You can read our in-depth tutorial on how to better PHP retentivity limit in WordPress for more than information.

Access your .htaccess file via FTP/SFTP or your hosting provider's File Director.

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

Open the.htaccess file with a text editor or lawmaking editor, then add together 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 can find two other PHP directives in the to a higher place lawmaking: max_execution_time and max_input_time . They define how long a server spends on a single PHP chore. The bigger your uploads, the bigger the time spent will be. Yous need to set their values to a number that's advisable for your use case.

Annotation: You may become a 500 Internal Server Error after using the method above. Most likely, it'south because your server is running PHP in CGI mode. In such cases, y'all cannot use the in a higher place commands in your .htaccess file.

Create or Change the 'php.ini' File

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

Using SSH or FTP, you tin discover the php.ini file in your WordPress root directory. In some cases, you may non locate it in that location. Fret not! You tin create a new file with the same name in your site'southward root directory.

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

With a code or text editor, add the following 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 subsequently making the changes. Some hosts don't allow you to alter PHP settings via this method. In such a case, you can keep to try the following solution instead.

Subscribe At present

Create or Modify the '.user.ini' File

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

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

Side by side, add the following code to your .user.ini file:

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

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

Change PHP Options via cPanel

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

To get started, become 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 can change your server'south current PHP version and enable/disable many PHP extensions. Click on the Options link in the navigation card to go to the PHP Options panel.

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

Scroll down here to alter 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 you tin set here depend on your current hosting plan.

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

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

Increase the Max Upload File Size in Nginx

Nginx is another webserver like Apache, simply it's as well a lot more. Typically, Nginx tin 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're running your WordPress site on Nginx, you'll need to modify both your php.ini and nginx.conf files. Nosotros've dealt with the former file earlier. The latter 1 is called an Nginx config file.

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

          upload_max_filesize = 64M post_max_size = 128M        

You don't have to prepare the memory_limit in the above file equally Nginx handles it differently. For more, you can cheque out this Stack Overflow thread. Afterwards saving your php.ini file, enable the changes past restarting PHP-FPM using the below code in your terminal:

          sudo service php7.iv-fpm restart        

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

Adjacent, apply Nginx's client_max_body_size directive to ready the new max upload size limit. You need to declare this directive in the nginx.conf file, which y'all can detect at /etc/nginx/nginx.conf .

Y'all tin can declare this directive inside the http {...} block, the server {...} block, or the location {...} block.

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

          http {     ...     client_max_body_size 128M; }        

Defining it in the server block will only affect a specific site/app hosted past this server.

          server {     ...     client_max_body_size 128M; }        

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

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

Don't forget to salve the file and restart Nginx to apply the changes. To exercise that, you can employ the following command in your terminal:

          sudo service nginx reload        

If you're a Kinsta customer, you can't access your Nginx config directly. Nonetheless, you tin reach out to our support team, and they can quickly make the changes for yous.

Use the WordPress 'upload_size_limit' Filter

WordPress ii.5 introduced the upload_size_limit filter, which filters the maximum upload size allowed in php.ini. Fifty-fifty WordPress uses this filter to testify yous the max upload size immune, like in the Media Library and Site Wellness Info screens.

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

          /** * Filter the upload size limit for non-administrators. * * @param string $size Upload size limit (in bytes). * @return int (mayhap) Filtered size limit. */ function filter_site_upload_size_limit( $size ) { // Fix the upload size limit to ten MB for users lacking the 'manage_options' adequacy. if ( ! current_user_can( 'manage_options' ) ) { // x MB. $size = 1024 * 10000; } return $size; } add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', xx );        

The in a higher place code uses WordPress' manage_options capability to set this limit merely for not-admins. Yous can modify the lawmaking to target specific user roles or user ids. Read our in-depth WordPress roles and capabilities article for more information.

Use a WordPress Plugin

Messing with code using SSH or FTP/SFTP is not for anybody. If you're not comfortable with writing or editing code, you lot 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's the just upwardly-to-appointment plugin on the WordPress plugin repository that helps you go this done.

To go started, install and actuate the WP Maximum Upload File Size plugin. Next, get to its settings screen in your WordPress dashboard. Here, you can see the maximum upload file size gear 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 run into that the maximum upload file size set past WordPress is bottom than that set by your hosting provider. Hence, you can creepo it up by choosing the Maximum Upload File Size with the dropdown presented.

Note: If you want to gear up a max upload file size limit that's larger than the one ready by your hosting provider, it's not possible to do it via this plugin. For that, you demand to contact your hosting provider.

Upload Files via FTP/SFTP

Are you lot still struggling with all the above methods? Or with your hosting provider to accept them raise the upload file size limit? You can always upload large files via FTP/SFTP.

FileZilla window with a site connected
Elevate and drib files to and for your server and computer with SFTP

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

Sometimes, WordPress doesn't recognize files uploaded via FTP/SFTP. If that's the case, you can use the free Add From Server plugin to import the uploaded files into WordPress.

Alternatively, you tin practise the aforementioned direct from the command line by importing images using WP-CLI. The wp media import control allows yous 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. Nosotros're calculation it here because we've found many spider web tutorials that list it as a legitimate way to increase the max upload size in WordPress.

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

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

Y'all're suggested to add the following lawmaking 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 you can only use the ini_set() function to set PHP directives that vest to the PHP_INI_ALL child-bearing fashion.

As upload_max_size and post_max_size belong to the PHP_INI_PERDIR changeable mode. You can only set up them via php.ini, .htaccess, http.conf, or .user.ini.

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

Verify Your WordPress Site's New Max Upload File Size

Finally, it's time to verify whether the new max upload file size limit is implemented in your WordPress site. To do this, follow the aforementioned procedure we discussed in a higher place to check 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 inverse.

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

Yes, it has changed. That's a success!

Yous can also get to the Site Health Info panel and check for the same under Media Handling and Server dropdowns.

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

Don't allow the maximum upload size in WordPress concord you dorsum! 🙅‍♂️ This guide will show you how you can hands increase the limit to accommodate your larger files 👇 Click to Tweet

Summary

Equally you've seen, increasing the maximum upload file size in WordPress isn't too complex. Whether you're edifice a media-heavy portfolio site or installing a large theme, it's just a matter of knowing where to look for and what commands or tools to apply.

In almost cases, reaching out to your hosting provider should be enough. Yet, if you're stuck with a troublesome host, we've shown you some culling methods you 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 set up it.


Salvage fourth dimension, costs and maximize site functioning with:

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

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-twenty-four hour period-coin-back-guarantee. Check out our plans or talk to sales to find the plan that's right for yous.