Skip to content Skip to sidebar Skip to footer

How to Increase Max File Upload to Wpengine Website

A low WordPress upload size limit stops you from uploading big files, plugins, and themes. If yous're building a media-heavy website, that can be a considerable obstruction. 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 means to go about solving this consequence. We'll cover them all in this commodity and show you how to increase the maximum upload size in WordPress quickly.

Let'due south dive in!

Adopt 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'south resources. To prevent users from causing server timeouts, the default maximum upload size in WordPress typically ranges from 4 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 nigh cases.

To verify this, become to your WordPress site'due south Media Library. Here, effort to upload a file that crosses this maximum upload file size limit. You'll run into 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" fault can be frustrating, just it exists for two principal reasons: security and efficiency. It hinders site owners and other users, including malicious actors, from uploading huge files (e.g. high-resolution images, big videos).

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

Want to upload a big file, plugin, or theme... only limited past the max upload size?🗂 Larn how to resolve this common issue chop-chop & hands right here ⬇️ Click to Tweet

How to Check the Current Maximum Upload Size in WordPress

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

In the Media Library

The quickest way to check your site'southward current maximum upload size is to become to your WordPress dashboard, and from there, become 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

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

Y'all can too go to Media > Add New straight and see the same bulletin displayed at the bottom.

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

Once again, yous tin run across the 128 MB max upload file size here.

In the Site Wellness Info

WordPress five.2 added the Site Health Info tool to assist you debug your WordPress site better. Here, yous can find almost all the data about your server and WordPress configuration.

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

First, you can discover information technology listed nether the Media Handling dropdown. Here, 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. You'll discover many options related to your webserver's setup under here. Please search for the value for Upload max filesize constant to see 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

Yous tin can likewise see other PHP constants and their values, such equally:

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

Your spider web host sets these options. Usually, starter hosting plans will have a lesser upload size limit than enterprise hosting plans. Some hosts may permit y'all to override these limits. But in most cases, you may demand your hosting provider's assistance (and perhaps a program upgrade) to increase them.

Why Increase 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. Hither are the most common ones:

  • You lot desire to install a large theme or plugin directly through the WordPress admin dashboard.
  • Updating your WordPress site regularly is a neat manner to proceed your readers engaged and return for more than. And that includes uploading new images, videos, audios, and other media regularly. However, that's not ever feasible when at that place's a file size limit for your uploads.
  • You lot desire to upload a large video or image as your site'southward groundwork or header.
  • Yous programme to sell digital files such every bit ebooks, photographs, videos, themes, and plugins directly from your site. Sometimes, these files tin can run upwardly to hundreds of megabytes (or more).

Now that we've covered the basics of max upload file size in WordPress, allow's learn how to increase it.

x Means to Increase the Max Upload File Size in WordPress

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

Contact Your Hosting Provider for Aid

If yous'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 task for tech support, so nearly hosting companies can help you lot gear up this result quickly.

Tinkering with your server or site configuration files can e'er be a challenge. Hence, we always recommend y'all endeavor this method outset.

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

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

We have representatives to assist y'all in many languages, including English language, 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.

First, caput to your Network Admin dashboard, so get to Settings > Network Settings screen. Hither, scroll downwards till you observe the Upload Settings section. Yous'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.5 MB). You lot can change this to a higher value and click the Save Changes push.

Note: Y'all cannot circumvent the server-level max upload size limit from here. If the limit you lot set here is higher than the server's max upload size limit, the server volition ignore information technology. You tin 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).

Y'all can also limit the full size of files uploaded to an private site in the Multisite network. However, it's disabled by default.

Update Your '.htaccess' File

If your webserver runs on Apache, you lot can update your site'due south .htaccess file to increase the max upload size in WordPress. You tin 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 Wellness Info section above. It would assist if you modified these three directives' values to acknowledge your file sizes. For instance, if the largest file you're planning to upload is 32 MB, we recommend the post-obit settings:

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

Notice, all the values use One thousand instead of MB. That's how PHP handles its directives.

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

Access your .htaccess file via FTP/SFTP or your hosting provider'south File Manager.

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

Open the.htaccess file with a text editor or code editor, and so add the post-obit 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 tin discover ii other PHP directives in the above 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 time spent will be. You need to set their values to a number that's advisable for your utilize case.

Notation: You may get a 500 Internal Server Error later on using the method in a higher place. Most likely, it'due south considering your server is running PHP in CGI mode. In such cases, you cannot utilize 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, information technology 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 non locate it there. Fret not! You can create a new file with the aforementioned proper 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 code 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 salve your file afterward making the changes. Some hosts don't allow you to modify PHP settings via this method. In such a example, yous can go on to try the following solution instead.

Subscribe Now

Create or Alter the '.user.ini' File

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

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

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

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

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

Alter PHP Options via cPanel

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

To get started, get to your cPanel dashboard, and select the Select PHP Version nether the Software section.

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

Hither, y'all tin change your server's current PHP version and enable/disable many PHP extensions. Click on the Options link in the navigation menu 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 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 you lot can set here depend on your current hosting programme.

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

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

Increase the Max Upload File Size in Nginx

Nginx is some other webserver like Apache, but it's also a lot more. Typically, Nginx 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 you're running your WordPress site on Nginx, you'll need to alter both your php.ini and nginx.conf files. We've dealt with the former file earlier. The latter one is called an Nginx config file.

On an Nginx server, you lot can detect the php.ini file at /etc/php/7.4/fpm/php.ini . Depending on which PHP version yous'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 in a higher place file as Nginx handles information technology differently. For more, you can check out this Stack Overflow thread. Subsequently saving your php.ini file, enable the changes by restarting PHP-FPM using the beneath code in your terminal:

          sudo service php7.four-fpm restart        

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

Next, use Nginx's client_max_body_size directive to set the new max upload size limit. You demand to declare this directive in the nginx.conf file, which you lot tin 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 merely affect a specific site/app hosted by this server.

          server {     ...     client_max_body_size 128M; }        

The location cake only affects the specified directory (e.g. files, uploads) inside a site/app.

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

Don't forget to salvage the file and restart Nginx to employ the changes. To do that, you lot can apply the post-obit control in your terminal:

          sudo service nginx reload        

If yous're a Kinsta customer, you lot can't access your Nginx config directly. However, you tin can attain out to our support squad, and they can rapidly make the changes for you.

Utilise 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. Even WordPress uses this filter to show you the max upload size allowed, similar in the Media Library and Site Health Info screens.

Beneath is an example of this filter in action from WordPress contributor Drew Jaynes. Information technology defines the upload size limit for all non-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 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', twenty );        

The above lawmaking uses WordPress' manage_options capability to gear up this limit but for non-admins. Y'all can modify 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 comfortable with writing or editing code, yous tin can use 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. As of writing this, it's the merely up-to-date plugin on the WordPress plugin repository that helps you go this washed.

To become started, install and activate the WP Maximum Upload File Size plugin. Side by side, go to its settings screen in your WordPress dashboard. Hither, you tin can see 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 can see that the maximum upload file size prepare past WordPress is lesser than that set by your hosting provider. Hence, you can crank it up by choosing the Maximum Upload File Size with the dropdown presented.

Note: If y'all desire to set a max upload file size limit that's larger than the i ready by your hosting provider, it's not possible to do it via this plugin. For that, you need to contact your hosting provider.

Upload Files via FTP/SFTP

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

FileZilla window with a site connected
Elevate and driblet 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 than information.

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

Alternatively, y'all tin can do the same directly from the command 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 hither considering we've found many spider web tutorials that list it as a legitimate mode to increase the max upload size in WordPress.

Information technology 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 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' );        

It fails to work because you tin only use the ini_set() function to set PHP directives that belong to the PHP_INI_ALL changeable mode.

As upload_max_size and post_max_size belong to the PHP_INI_PERDIR child-bearing mode. You lot can simply fix them via php.ini, .htaccess, http.conf, or .user.ini.

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

Verify Your WordPress Site'south 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 practise this, follow the same process we discussed higher up 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, information technology has changed. That's a success!

You can too go to the Site Health Info panel 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 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 allow the maximum upload size in WordPress concur yous dorsum! 🙅‍♂️ This guide will show yous how you can easily increase the limit to adapt your larger files 👇 Click to Tweet

Summary

As you've seen, increasing the maximum upload file size in WordPress isn't as well circuitous. Whether y'all're building a media-heavy portfolio site or installing a large theme, it'due south just a matter of knowing where to look for and what commands or tools to utilise.

In virtually cases, reaching out to your hosting provider should exist enough. Still, if you're stuck with a troublesome host, we've shown you some alternative methods you can try before migrating to improve hosting.

Get uploading!

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


Save fourth dimension, costs and maximize site operation with:

  • Instant assistance from WordPress hosting experts, 24/vii.
  • Cloudflare Enterprise integration.
  • Global audience accomplish with 29 information 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-back-guarantee. Check out our plans or talk to sales to find the programme that's correct for you.

solorzanojoyinewerhat.blogspot.com

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

Postar um comentário for "How to Increase Max File Upload to Wpengine Website"