Skip to content Skip to sidebar Skip to footer

How to Check Max Upload File Size on Server?

A depression WordPress upload size limit stops y'all from uploading large files, plugins, and themes. If y'all're edifice a media-heavy website, that can exist 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, there are many ways to go about solving this upshot. Nosotros'll cover them all in this article and testify y'all how to increase the maximum upload size in WordPress speedily.

Let's dive in!

Prefer to spotter the video version?

What Is the Maximum Upload Size in WordPress?

Uploading big files to a server consumes a lot of the server's resources. To preclude users from causing server timeouts, the default maximum upload size in WordPress typically ranges from 4 MB to 128 MB. Ordinarily, the hosting provider sets this limit at the server level.

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

To verify this, get to your WordPress site's Media Library. Here, endeavour to upload a file that crosses this maximum upload file size limit. You'll meet an error message 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" error tin 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 (e.thou. high-resolution images, large videos).

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

Want to upload a big file, plugin, or theme... simply limited by the max upload size?🗂 Learn how to resolve this common issue quickly & easily correct 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 style to check your site'south current maximum upload size is to become to your WordPress dashboard, and from at that place, get to Media > Library. Here, 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

Equally Kinsta hosts this site, the Maximum upload file size: 128 MB. message displays beneath the Select Files button. If you're using a different web hosting provider, you may run across a different limit listed here.

Yous tin also go to Media > Add New directly and come across the same bulletin displayed at the bottom.

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

Once again, you can come across the 128 MB max upload file size here.

In the Site Health Info

WordPress 5.2 added the Site Wellness Info tool to assistance you debug your WordPress site amend. Here, you can find nigh all the data almost your server and WordPress configuration.

Equally both the server and WordPress handle the max upload file size, in that location are two means to find its value on this screen.

First, you lot can find it listed under the Media Handling dropdown. Here, look 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 nether the Server dropdown. You lot'll notice many options related to your webserver'south setup nether hither. Delight search for the value for Upload max filesize constant 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 Wellness Info' panel

You lot can likewise run across other PHP constants and their values, such equally:

  • PHP post max size: Defines the maximum upload limit for Mail service requests.
  • PHP memory limit: Defines the retentiveness allocated for PHP. It 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. Ordinarily, starter hosting plans will have a lesser upload size limit than enterprise hosting plans. Some hosts may allow you lot to override these limits. But in most cases, you may need your hosting provider'south assistance (and maybe a plan upgrade) to increment them.

Why Increment the Maximum Upload File Size in WordPress?

There are many reasons why you may need to increment your WordPress site's maximum upload file size. Here are the near mutual ones:

  • You want to install a large theme or plugin directly through the WordPress admin dashboard.
  • Updating your WordPress site regularly is a dandy way to proceed your readers engaged and return for more than. And that includes uploading new images, videos, audios, and other media regularly. Even so, that's non ever feasible when there'southward a file size limit for your uploads.
  • Yous want to upload a large video or prototype equally your site's background or header.
  • You program to sell digital files such as ebooks, photographs, videos, themes, and plugins directly from your site. Sometimes, these files tin run upwards to hundreds of megabytes (or more than).

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

ten Means to Increase the Max Upload File Size in WordPress

In that location are many ways you can gear up the WordPress maximum upload size consequence. We'll start with the easiest ones first, and so we'll motility on to the intermediate-level tutorials.

Contact Your Hosting Provider for Help

If you're facing issues 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 chore for tech support, then near hosting companies can help you fix this event quickly.

Tinkering with your server or site configuration files can always exist a challenge. Hence, we ever recommend you try this method first.

If you're hosting your site with Kinsta, our knowledgeable support squad is but 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 aid you in many languages, including English, Spanish, French, German, Italian, and Portuguese.

Increase the Max Upload File Size in WordPress Multisite

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

Get-go, caput to your Network Admin dashboard, and then get to Settings > Network Settings screen. Hither, whorl downwards till you lot observe the Upload Settings section. Y'all'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 lot can change this to a higher value and click the Save Changes button.

Note: Y'all cannot circumvent the server-level max upload size limit from here. If the limit you fix here is college than the server's max upload size limit, the server volition ignore it. You can use the methods described to a higher place to discover 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).

Y'all 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, you can update your site's .htaccess file to increment the max upload size in WordPress. You tin can observe your .htaccess file in the WordPress site's 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 department to a higher place. It would assist if y'all modified these three directives' values to admit your file sizes. For example, if the largest file you're planning to upload is 32 MB, we 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's how PHP handles its directives.

Uploads can contain extra information in addition to the file itself. So, giving all other upload-related directives some animate space is a proficient idea. Yous can read our in-depth tutorial on how to improve PHP memory limit in WordPress for more information.

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

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

Open the.htaccess file with a text editor or code editor, 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 can notice ii other PHP directives in the higher up code: max_execution_time and max_input_time . They define how long a server spends on a single PHP task. The bigger your uploads, the bigger the fourth dimension spent will exist. You demand to set their values to a number that's appropriate for your use case.

Note: You may get a 500 Internal Server Fault after using the method above. Nigh likely, it'south because your server is running PHP in CGI mode. In such cases, you cannot apply the higher up commands in your .htaccess file.

Create or Alter the 'php.ini' File

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

Using SSH or FTP, yous can find the php.ini file in your WordPress root directory. In some cases, you lot may not locate it there. Fret non! Y'all tin create a new file with the same name in your site'south 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 together 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 after making the changes. Some hosts don't allow yous to modify PHP settings via this method. In such a case, you lot tin can proceed to try the post-obit 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 take configured the server to work with .user.ini files instead of php.ini files.

Like php.ini and .htaccess files, y'all can detect the .user.ini in your site'southward root directory. If you can't notice 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.

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

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

You lot'll notice that information technology'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 y'all manage your server and site configuration, you tin change 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 section.

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

Hither, you can alter your server's electric current PHP version and enable/disable many PHP extensions. Click on the Options link in the navigation bill of fare 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 hither depend on your current hosting plan.

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

If you take any doubts near these values, we propose you contact your hosting provider. The latest cPanel dashboard saves changes automatically, so yous don't take to click anything. Merely if you're using an older cPanel version, make sure to click the Relieve Changes push.

Increase the Max Upload File Size in Nginx

Nginx is another webserver like Apache, but 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 functioning-optimized hosting solutions for WordPress.

If yous'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 sometime file earlier. The latter 1 is chosen an Nginx config file.

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

          upload_max_filesize = 64M post_max_size = 128M        

You don't have to set the memory_limit in the above file as Nginx handles information technology differently. For more, you tin can check out this Stack Overflow thread. Afterwards saving your php.ini file, enable the changes by restarting PHP-FPM using the below code in your concluding:

          sudo service php7.4-fpm restart        

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

Adjacent, employ Nginx'southward client_max_body_size directive to set the new max upload size limit. You need to declare this directive in the nginx.conf file, which y'all tin can find at /etc/nginx/nginx.conf .

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

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

          http {     ...     client_max_body_size 128M; }        

Defining it in the server block volition only impact a specific site/app hosted by this server.

          server {     ...     client_max_body_size 128M; }        

The location block only affects the specified directory (eastward.grand. files, uploads) inside a site/app.

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

Don't forget to relieve the file and restart Nginx to apply the changes. To practice that, y'all can use the post-obit command in your terminal:

          sudo service nginx reload        

If you're a Kinsta customer, you lot can't access your Nginx config straight. Nonetheless, y'all can reach out to our back up team, and they can quickly make the changes for you lot.

Employ the WordPress 'upload_size_limit' Filter

WordPress two.5 introduced the upload_size_limit filter, which filters the maximum upload size allowed in php.ini. Even WordPress uses this filter to show you the max upload size allowed, like in the Media Library and Site Wellness Info screens.

Below is an instance 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 (maybe) Filtered size limit. */ function filter_site_upload_size_limit( $size ) { // Set up 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; } return $size; } add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 20 );        

The in a higher place code uses WordPress' manage_options capability to fix this limit only for non-admins. You lot can change the code 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 everyone. If you're not comfy with writing or editing code, you lot tin apply a WordPress plugin instead.

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

We'll be using the WP Maximum Upload File Size plugin here. Every bit of writing this, it's the only up-to-engagement plugin on the WordPress plugin repository that helps you become 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. Here, yous can run across the maximum upload file size set by both your hosting provider and WordPress.

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

Here, you tin can meet that the maximum upload file size set by WordPress is lesser than that set up past your hosting provider. Hence, you tin crank information technology up by choosing the Maximum Upload File Size with the dropdown presented.

Annotation: If y'all desire to ready a max upload file size limit that's larger than the one set past your hosting provider, it'southward not possible to do information technology via this plugin. For that, you lot need to contact your hosting provider.

Upload Files via FTP/SFTP

Are yous still struggling with all the above methods? Or with your hosting provider to accept them heighten the upload file size limit? You tin 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 have a lot of large files to upload, this is the fastest method. You tin can 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'southward the case, you can apply the costless Add From Server plugin to import the uploaded files into WordPress.

Alternatively, you tin can do the aforementioned straight from the control line past importing images using WP-CLI. The wp media import control 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 piece of work anymore. We're calculation information technology here because we've plant many 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 and then 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 post-obit code to the wp-config.php file:

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

It fails to piece of work because you tin merely employ the ini_set() role to gear up PHP directives that belong to the PHP_INI_ALL changeable way.

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

If you lot've tried this method before without seeing whatsoever results, now yous 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 practice this, follow the same procedure we discussed above to check the max upload file size in WordPress.

Go to your Media Library in the WordPress dashboard and bank 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, it has changed. That'south a success!

You can also go to the Site Health Info console and cheque for the aforementioned 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 Health Info > Server'

Don't let the maximum upload size in WordPress hold yous back! 🙅‍♂️ This guide will show you how you can easily increase the limit to accommodate your larger files 👇 Click to Tweet

Summary

As you've seen, increasing the maximum upload file size in WordPress isn't too complex. Whether you're building a media-heavy portfolio site or installing a large theme, information technology's just a affair of knowing where to look for and what commands or tools to utilise.

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

Get uploading!

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


Save fourth dimension, costs and maximize site performance with:

  • Instant help from WordPress hosting experts, 24/seven.
  • Cloudflare Enterprise integration.
  • Global audition reach with 29 information centers worldwide.
  • Optimization with our born Awarding Performance Monitoring.

All of that and much more, in 1 plan with no long-term contracts, assisted migrations, and a xxx-day-money-back-guarantee. Check out our plans or talk to sales to detect the plan that'southward right for you lot.

daletionve84.blogspot.com

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

Post a Comment for "How to Check Max Upload File Size on Server?"