How Do You Upload Bigger Than 2meg Files in Wordpress
A low WordPress upload size limit stops you from uploading large files, plugins, and themes. If you lot'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 ways to go nearly solving this issue. We'll cover them all in this article and prove you how to increase the maximum upload size in WordPress quickly.
Permit'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'due south resources. To forestall users from causing server timeouts, the default maximum upload size in WordPress typically ranges from 4 MB to 128 MB. Commonly, the hosting provider sets this limit at the server level.
WordPress likewise includes constants that define this limit, but they cannot override the server-level settings in well-nigh cases.
To verify this, go to your WordPress site'south Media Library. Hither, endeavor to upload a file that crosses this maximum upload file size limit. You'll meet an fault bulletin that looks something like this:

The "exceeds the maximum upload size for this site" error tin can be frustrating, just 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 (e.one thousand. high-resolution images, large videos).
Otherwise, it can effect in incapacitating your website's server, making your site come to a crawl. Or worse, it can bring your site down altogether!
How to Check the Current Maximum Upload Size in WordPress
There are many ways to check your WordPress site's current max upload size. Allow'southward go through all of them.
In the Media Library
The quickest way to check your site's current maximum upload size is to go to your WordPress dashboard, and from there, go to Media > Library. Here, click on the Add New button to activate the media uploader tool.

As Kinsta hosts this site, the Maximum upload file size: 128 MB.
message displays below the Select Files push button. If y'all're using a different web hosting provider, you lot may see a different limit listed hither.
You tin too go to Media > Add New directly and see the same message displayed at the bottom.

Again, you can see the 128 MB max upload file size here.
In the Site Health Info
WordPress v.2 added the Site Health Info tool to help you debug your WordPress site better. Hither, y'all can find almost all the information nigh your server and WordPress configuration.
As both the server and WordPress handle the max upload file size, at that place are two ways to observe its value on this screen.
First, you can find it listed under the Media Handling dropdown. Hither, look for the value of Max size of an uploaded file
constant.

The second method is to look under the Server dropdown. Yous'll observe many options related to your webserver'due south setup under here. Delight 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.

You can also run across other PHP constants and their values, such as:
-
PHP mail service max size
: Defines the maximum upload limit for Postal service requests. -
PHP memory limit
: Defines the retentivity allocated for PHP. It should exist set equal to or higher than theUpload max filesize
limit. Or else the upload volition neglect.
Your web host sets these options. Normally, starter hosting plans will take a bottom upload size limit than enterprise hosting plans. Some hosts may allow you to override these limits. But in virtually cases, you may need your hosting provider's assistance (and perhaps a programme upgrade) to increase them.
Why Increase the Maximum Upload File Size in WordPress?
There are many reasons why you may need to increase your WordPress site's maximum upload file size. Hither are the most common ones:
- You lot want to install a big theme or plugin directly through the WordPress admin dashboard.
- Updating your WordPress site regularly is a bully way 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 not e'er viable when in that location's a file size limit for your uploads.
- You want to upload a large video or image 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 can sew to hundreds of megabytes (or more).
Now that we've covered the nuts of max upload file size in WordPress, let'due south learn how to increase it.
10 Ways to Increase the Max Upload File Size in WordPress
There are many ways yous can set up the WordPress maximum upload size issue. We'll start with the easiest ones beginning, and so we'll move on to the intermediate-level tutorials.
Contact Your Hosting Provider for Help
If you're facing bug with uploading files and file size limits, reaching out to your hosting provider for assistance is 1 of the quickest solutions. Increasing the upload limit is a fiddling task for tech support, so most hosting companies can help y'all fix this issue apace.
Tinkering with your server or site configuration files can always be a challenge. Hence, we ever recommend you try this method first.
If you're hosting your site with Kinsta, our knowledgeable support squad is just a click away and available 24/7. To get started, become to your MyKinsta dashboard and click the chat icon in the bottom right corner.

We take representatives to help you lot in many languages, including English, Castilian, French, German language, Italian, and Portuguese.
Increment the Max Upload File Size in WordPress Multisite
If you're running a WordPress Multisite network, then you lot tin alter the max upload file size for your network.
Get-go, head to your Network Admin dashboard, and then go to Settings > Network Settings screen. Here, coil down till you lot discover the Upload Settings department. You'll find the Max upload file size
field in this area.

The default value of Max upload file size in a WordPress Multisite is 1500 KB (~1.five MB). You tin modify this to a college value and click the Save Changes push button.
Note: You cannot circumvent the server-level max upload size limit from here. If the limit you lot fix here is higher than the server's max upload size limit, the server will ignore information technology. You tin can use the methods described to a higher place to observe your webserver's configuration.

Here, we've prepare the new max upload file size to 131072 KB (~128 MB).
Yous can likewise limit the total size of files uploaded to an private site in the Multisite network. Nonetheless, it's disabled by default.
Update Your '.htaccess' File
If your webserver runs on Apache, you lot tin update your site's .htaccess file to increment the max upload size in WordPress. You can notice 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 Health Info department above. It would help if y'all modified these three directives' values to admit your file sizes. For instance, if the largest file y'all're planning to upload is 32 MB, we recommend the following settings:
-
upload_max_filesize = 32M
-
post_max_size = 64M
-
memory_limit = 128M
Find, all the values employ One thousand 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 breathing space is a expert thought. You 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's File Manager.

Open the.htaccess file with a text editor or code editor, and and so add the post-obit lawmaking:
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 notice ii other PHP directives in the to a higher place 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 lot need to fix their values to a number that's appropriate for your use case.
Note: You lot may go a 500 Internal Server Fault afterward using the method in a higher place. Most likely, it'south because your server is running PHP in CGI fashion. In such cases, you cannot use the above commands in your .htaccess file.
Create or Modify the 'php.ini' File
The php.ini file is where you lot 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 lot can notice the php.ini file in your WordPress root directory. In some cases, you may not locate it at that place. Fret not! You can create a new file with the aforementioned proper noun in your site's root directory.

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 salvage your file after making the changes. Some hosts don't permit you to change PHP settings via this method. In such a instance, yous 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 down 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, you can find the .user.ini in your site's root directory. If you tin't find it, so you lot tin 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.
Side by side, add the following lawmaking to your .user.ini file:
upload_max_filesize = 32M post_max_size = 64M memory_limit = 128M
You'll detect that it'south a echo 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 manage your server and site configuration, you can alter the max upload file size through its interface.
To become started, become to your cPanel dashboard, and select the Select PHP Version nether the Software department.

Here, you can change your server'southward current PHP version and enable/disable many PHP extensions. Click on the Options link in the navigation carte to go to the PHP Options console.

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 plan.

If you accept any doubts nigh these values, we suggest you contact your hosting provider. The latest cPanel dashboard saves changes automatically, and 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.
Increase the Max Upload File Size in Nginx
Nginx is another webserver similar Apache, but information technology's also a lot more than. Typically, Nginx tin can handle more concurrent requests than Apache, making information technology a lot faster. Kinsta uses Nginx to power its performance-optimized hosting solutions for WordPress.
If y'all're running your WordPress site on Nginx, you'll demand to modify both your php.ini and nginx.conf files. We've dealt with the former file before. The latter i is chosen an Nginx config file.
On an Nginx server, you can detect 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 ready the memory_limit
in the in a higher place file equally Nginx handles it differently. For more, you tin bank check out this Stack Overflow thread. Later on saving your php.ini file, enable the changes by restarting PHP-FPM using the below code in your last:
sudo service php7.4-fpm restart
Again, the exact code may vary slightly depending on the PHP version installed on your server.
Next, utilize Nginx's client_max_body_size
directive to ready the new max upload size limit. You lot demand to declare this directive in the nginx.conf file, which yous can observe at /etc/nginx/nginx.conf
.
You can declare this directive inside the http {...}
block, the server {...}
block, or the location {...}
cake.
Setting information technology in the http cake will affect all the sites/apps hosted on this server.
http { ... client_max_body_size 128M; }
Defining it in the server block volition simply impact a specific site/app hosted by this server.
server { ... client_max_body_size 128M; }
The location block only affects the specified directory (e.1000. files, uploads) inside a site/app.
location /files { ... client_max_body_size 128M; }
Don't forget to save the file and restart Nginx to employ the changes. To do that, you can employ the following command in your terminal:
sudo service nginx reload
If you lot're a Kinsta client, you can't access your Nginx config directly. However, you can attain out to our support squad, and they can chop-chop make the changes for you.
Apply 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. Fifty-fifty WordPress uses this filter to testify you the max upload size allowed, like in the Media Library and Site Wellness Info screens.
Below is an case 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. */ role filter_site_upload_size_limit( $size ) { // Prepare the upload size limit to 10 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', 20 );
The to a higher place code uses WordPress' manage_options
capability to set up this limit but for not-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, y'all tin can employ a WordPress plugin instead.

Nosotros'll be using the WP Maximum Upload File Size plugin here. As of writing this, it's the but up-to-date plugin on the WordPress plugin repository that helps you get this done.
To go 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 see the maximum upload file size prepare by both your hosting provider and WordPress.

Here, you tin can see that the maximum upload file size set by WordPress is lesser than that prepare by your hosting provider. Hence, you tin can crank it upwards by choosing the Maximum Upload File Size with the dropdown presented.
Notation: If you lot want to set a max upload file size limit that's larger than the one set by your hosting provider, it's not possible to do information technology via this plugin. For that, you need to contact your hosting provider.
Upload Files via FTP/SFTP
Are you however struggling with all the to a higher place methods? Or with your hosting provider to accept them raise the upload file size limit? You tin always upload large files via FTP/SFTP.

If you have a lot of big 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'southward the example, y'all can use the free Add From Server plugin to import the uploaded files into WordPress.
Alternatively, you can do the same straight from the command line by importing images using WP-CLI. The wp media import
command allows y'all 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 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.

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' );
Information technology fails to work because you tin can merely use the ini_set() function to prepare PHP directives that belong to the PHP_INI_ALL changeable fashion.
Every bit upload_max_size
and post_max_size
belong to the PHP_INI_PERDIR changeable way. You can only set them via php.ini, .htaccess, http.conf, or .user.ini.
If you lot've tried this method earlier without seeing any results, now you know why it fails.
Verify Your WordPress Site'southward 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 aforementioned procedure we discussed above to check the max upload file size in WordPress.
Go to your Media Library in the WordPress dashboard and cheque whether the max upload file size limit has changed.

Yeah, it has changed. That's a success!
You can also go to the Site Health Info panel and check for the same under Media Treatment and Server dropdowns.


Summary
As yous've seen, increasing the maximum upload file size in WordPress isn't also circuitous. Whether you're building a media-heavy portfolio site or installing a large theme, it's just a thing of knowing where to await for and what commands or tools to use.
In most cases, reaching out to your hosting provider should exist enough. Even so, if y'all're stuck with a troublesome host, we've shown you some alternative methods you tin try earlier migrating to meliorate hosting.
Get uploading!
Did nosotros cover it all? If you've experienced a stubborn case of upload file size limits, let the states know how you managed to fix information technology.
Save time, costs and maximize site operation with:
- Instant help from WordPress hosting experts, 24/seven.
- 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 xxx-solar day-coin-back-guarantee. Check out our plans or talk to sales to notice the plan that's correct for you.
Source: https://kinsta.com/blog/increase-max-upload-size-wordpress/
Post a Comment for "How Do You Upload Bigger Than 2meg Files in Wordpress"