How to Upload Big Files to the WP Media Library

Jan 30, 2022 | Tutorials

The WordPress Media Library makes it easy to add and manage small media files for sharing on your website. When uploading big files it stops working or you get an error. There are various reasons big files may not be uploading, but most of the time it involves a limitation on your hosting service.

In this tutorial, you will learn four ways for adding big media files to the media library. This will be especially helpful if you want to upload videos or other large files. Before uploading large video files for playback on your site, be sure and transcode them for the best performance. Let’s explore all the options.

Method 1: Using Big File Uploads

This is the easiest and safest method. Big File Uploads is specifically designed to bypass the hosting/PHP limitations on file size limit and will allow you to upload any file size you want.

The first step is to download the plugin, you can get it free on the WordPress repository.

After the plugin has been installed, activate it and look for the configuration settings under the Settings menu item.

The plugin is straightforward and will easily allow you to change the maximum file upload size in a single window. Just set the limit for maximum file upload size. You can even set upload Maximum size by user role by toggling on the customize user role.

This way you can set each role with specific file size limits. That’s all there is to it.

One limitation with Big File Uploads is that most frontend upload tools and form builder plugins that allow your users to upload files to your site do not use the same codebase as the WordPress media uploader. Big File Uploads will continue to work but will not increase the max size for uploads using other methods.

To increase the upload limit for a frontend plugin or page builder uploader you will need to use another method.

Method 2: Tweak the .htaccess file

This method require access to the .htaccess file and It may not work depending on the rules set by your hosting provider. Just add the following lines to the top of your .htaccess file:

php_value upload_max_filesize 1024M
php_value post_max_size 1024M
php_value max_execution_time 256
php_value max_input_time 256

After these values are added, reload your site. If you see an Internal Server Error message, delete those lines of code and reload. This means that your hosting provider is limiting you from modifying those variables. After reverting your file, you can try the next method.

Method 3: Tweaking the php.ini

Another method to increase the upload file size limit is to add the values directly into the php.ini file.

The file must be placed in the root folder of your domain and this process will only work if your host uses Apache. If you have a .htaccess in your root folder, you can use this method.

Create a php.ini, add the following commands, and save.

upload_max_filesize = “1024M”
post_max_size = “1024M”
max_execution_time = “256”
max_input_time = “256”

This will allow you to add up to 1GB files. Just be aware that if you get an Internal Server Error again after doing this, you may have restricted access to modify these variables so you will need to delete the file and proceed to method 3.

Method 3: Asking your hosting provider to raise limits

Your hosting provider may have restricted access to increase your upload filesize limits, if tweaking PHP variables in the .htaccess file does not work, you can ask your host to increase the limits for you. Open a support ticket and ask them to modify the following PHP variables for your domain:

max_execution_time = 256
max_input_time = 256
post_max_size = 1024M
upload_max_filesize = 1024M

With these parameters, you’ll be able to upload a max file of up to 1GB with more than 250 seconds of timeout for the upload process which will give you a safe margin.

Method 4: Using FTP

To use FTP, you will need an FTP account and client for managing the files. The FTP account must have write access and you need to point your home folder to the home folder of your domain account. The location will vary from host to host, for example, on Plesk the home folder is usually in htdocs and on cPanel the home folder is at public_html.

Once the FTP account is created, upload the file contents into your wp-content/upload folder

This is the most complex method since it will require you to also add the images to the media library afterward. Uploading images to your image gallery this way will not immediately add them. To do this, use a plugin like Add From Server.

Once the plugin has been installed, you will have to search for the images manually

Search for your images in the uploads folder on the specific folder you used to upload, which should be your current month/year, add the images and click on Import.

After the images or video has been imported you will see them in your media library.

Wrapping Up

Now you are armed with several ways you can upload big media files into the WordPress media library. Most of the time, Big File Uploads will be enough. If you want to manage it manually or have special requirements you can contact your host or use one of the other methods to get large files added to your website.

0 Comments

Submit a Comment

Your email address will not be published.