Skip to content Skip to sidebar Skip to footer

How to Upload a Video to Wordpress That Is Bigger Than 2mb

A depression WordPress upload size limit stops you from uploading large files, plugins, and themes. If you're building a media-heavy website, that can be a considerable obstacle. It'due south 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 effect. Nosotros'll cover them all in this article and testify you how to increment the maximum upload size in WordPress rapidly.

Let's swoop in!

Prefer to lookout the video version?

What Is the Maximum Upload Size in WordPress?

Uploading large files to a server consumes a lot of the server'southward resources. To forestall 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 too includes constants that define this limit, simply they cannot override the server-level settings in most cases.

To verify this, go to your WordPress site'due south Media Library. Here, effort to upload a file that crosses this maximum upload file size limit. Yous'll see an error message that looks something similar 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 information technology exists for two main reasons: security and efficiency. It hinders site owners and other users, including malicious actors, from uploading huge files (east.k. high-resolution images, big videos).

Otherwise, it can upshot in incapacitating your website'southward server, making your site come up to a crawl. Or worse, information technology can bring your site down altogether!

Desire to upload a large file, plugin, or theme... only limited by the max upload size?🗂 Learn how to resolve this common issue quickly & easily correct here ⬇️ Click to Tweet

How to Check the Current Maximum Upload Size in WordPress

There are many ways to check your WordPress site's current max upload size. Permit's become through all of them.

In the Media Library

The quickest mode to check your site's current maximum upload size is to go to your WordPress dashboard, and from in that location, go 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

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

Y'all can also go to Media > Add New directly and run into the same message displayed at the bottom.

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

Again, you tin can see the 128 MB max upload file size here.

In the Site Health Info

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

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

First, you lot can detect information technology listed nether the Media Handling dropdown. Hither, 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 Wellness Info' panel

The second method is to look under the Server dropdown. You'll find many options related to your webserver'due south setup under here. Please search for the value for Upload max filesize constant to come across 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

Yous can also run into other PHP constants and their values, such as:

  • PHP post max size: Defines the maximum upload limit for POST requests.
  • PHP memory limit: Defines the memory allocated for PHP. It should exist fix 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 take a bottom upload size limit than enterprise hosting plans. Some hosts may let y'all to override these limits. But in most cases, you may demand your hosting provider's assistance (and maybe a program upgrade) to increase them.

Why Increase the Maximum Upload File Size in WordPress?

In that location are many reasons why yous may need to increase your WordPress site's maximum upload file size. Here are the most common ones:

  • You desire to install a large theme or plugin direct through the WordPress admin dashboard.
  • Updating your WordPress site regularly is a great way to keep your readers engaged and render for more. And that includes uploading new images, videos, audios, and other media regularly. However, that's not always feasible when there's a file size limit for your uploads.
  • Y'all want to upload a large video or image every bit your site's background or header.
  • You plan to sell digital files such every bit 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's larn how to increase information technology.

10 Ways to Increase the Max Upload File Size in WordPress

There are many means you can fix the WordPress maximum upload size issue. We'll outset with the easiest ones commencement, 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 i of the quickest solutions. Increasing the upload limit is a trivial chore for tech support, so most hosting companies can aid y'all set up this issue apace.

Tinkering with your server or site configuration files tin ever be a challenge. Hence, nosotros ever recommend you effort this method kickoff.

If you're hosting your site with Kinsta, our knowledgeable back up team is just a click away and available 24/vii. 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 assist y'all in many languages, including English language, Spanish, French, German, Italian, and Portuguese.

Increment the Max Upload File Size in WordPress Multisite

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

Outset, head to your Network Admin dashboard, then go to Settings > Network Settings screen. Here, scroll downwards till you find the Upload Settings section. You lot'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 higher value and click the Save Changes button.

Note: You lot cannot circumvent the server-level max upload size limit from here. If the limit you set here is higher than the server's max upload size limit, the server will ignore it. You lot 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 can too 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 tin 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

Nosotros've already discussed them in the Site Health Info department to a higher place. It would help if you modified these 3 directives' values to admit 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 employ M instead of MB. That's how PHP handles its directives.

Uploads can contain extra information in add-on to the file itself. And then, giving all other upload-related directives some animate space is a good idea. 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's File Manager.

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

Open the.htaccess file with a text editor or code editor, so 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 can notice 2 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 job. The bigger your uploads, the bigger the time spent will be. You need to gear up their values to a number that's appropriate for your use case.

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

Create or Change the 'php.ini' File

The php.ini file is where you 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, yous tin find the php.ini file in your WordPress root directory. In some cases, you may not locate information technology at that place. Fret not! You can 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 code or text editor, add together 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 case, you can proceed to endeavor the post-obit solution instead.

Subscribe At present

Create or Modify the '.user.ini' File

If your hosting provider has locked downwardly 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 find the .user.ini in your site'south root directory. If yous tin can't find it, and so you can create a new .user.ini file in the aforementioned location. Follow the same 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'll find that it'due south 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 lot 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, you can change your server's current PHP version and enable/disable many PHP extensions. Click on the Options link in the navigation menu to become to the PHP Options console.

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

Scroll downwardly 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 tin 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 almost these values, we suggest you contact your hosting provider. The latest cPanel dashboard saves changes automatically, so you don't have to click annihilation. Just if you lot're using an older cPanel version, make sure to click the Relieve Changes button.

Increment the Max Upload File Size in Nginx

Nginx is another webserver like Apache, simply information technology'south too a lot more. Typically, Nginx 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 you'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 1 is called an Nginx config file.

On an Nginx server, you tin can notice the php.ini file at /etc/php/vii.four/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        

Y'all don't have to fix the memory_limit in the above file every bit Nginx handles it differently. For more, y'all can bank check out this Stack Overflow thread. After saving your php.ini file, enable the changes by restarting PHP-FPM using the beneath 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.

Adjacent, use Nginx's 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 you can find at /etc/nginx/nginx.conf .

Yous can declare this directive inside the http {...} block, the server {...} cake, 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 cake will only affect a specific site/app hosted past this server.

          server {     ...     client_max_body_size 128M; }        

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

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

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

          sudo service nginx reload        

If y'all're a Kinsta client, you can't access your Nginx config straight. However, you can accomplish out to our support team, and they tin rapidly make the changes for you lot.

Use the WordPress 'upload_size_limit' Filter

WordPress 2.v introduced the upload_size_limit filter, which filters the maximum upload size allowed in php.ini. Even WordPress uses this filter to bear witness you the max upload size allowed, like in the Media Library and Site Health Info screens.

Below is an instance of this filter in activeness from WordPress correspondent Drew Jaynes. It 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 (mayhap) Filtered size limit. */ function filter_site_upload_size_limit( $size ) { // Set the upload size limit to x MB for users defective the 'manage_options' capability. 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 to a higher place code uses WordPress' manage_options capability to set this limit simply for not-admins. You 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 lawmaking using SSH or FTP/SFTP is not for everyone. If you're non comfortable with writing or editing code, 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. Equally of writing this, it'due south the only upwardly-to-date plugin on the WordPress plugin repository that helps y'all get this washed.

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 see the maximum upload file size fix past both your hosting provider and WordPress.

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

Hither, you tin meet that the maximum upload file size prepare by WordPress is lesser than that set past your hosting provider. Hence, yous can crank it upward by choosing the Maximum Upload File Size with the dropdown presented.

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

Upload Files via FTP/SFTP

Are you lot still struggling with all the in a higher place methods? Or with your hosting provider to have them raise the upload file size limit? You lot can e'er upload big files via FTP/SFTP.

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

If yous have a lot of large files to upload, this is the fastest method. You can read our in-depth tutorial on how to bulk upload files to the WordPress media library for more than data.

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 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 nosotros've found many web tutorials that list it equally a legitimate style to increase the max upload size in WordPress.

It involves going to your site'southward 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 considering you tin but use the ini_set() function to prepare PHP directives that belong to the PHP_INI_ALL changeable mode.

Every bit upload_max_size and post_max_size vest to the PHP_INI_PERDIR child-bearing mode. You can only gear up them via php.ini, .htaccess, http.conf, or .user.ini.

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

Verify Your WordPress Site's New Max Upload File Size

Finally, information technology's time 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 above 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 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 become to the Site Wellness Info panel and check for the same nether 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 you back! 🙅‍♂️ This guide will testify yous how y'all tin easily increment the limit to arrange your larger files 👇 Click to Tweet

Summary

Every bit yous'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 large theme, it's simply a matter of knowing where to await for and what commands or tools to apply.

In nearly cases, reaching out to your hosting provider should be enough. Nonetheless, if y'all're stuck with a troublesome host, we've shown y'all some alternative methods you tin endeavour before migrating to improve hosting.

Become uploading!

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


Save fourth dimension, costs and maximize site functioning with:

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

All of that and much more, in one program with no long-term contracts, assisted migrations, and a xxx-day-coin-back-guarantee. Check out our plans or talk to sales to find the plan that's right for you.

fullerfaight.blogspot.com

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

Post a Comment for "How to Upload a Video to Wordpress That Is Bigger Than 2mb"