The WordPress Media Library makes it easy to manage and share all types of files from images and videos to audio and PDF files. But max file size limits and server timeout errors make it hard to add large files to the WordPress Media Library.
If you are getting an error when trying to upload a big file there are several ways to increase the capability of the media uploader. In this post, we will show you three methods for adding big files to your media library.
- Increase the limit set by your hosting provider
- Use FTP and use the Add From Server plugin
- Use the Big File Uploads plugin
The media library is great for managing files and a smart way to keep all your files in order. If your hosting company has strict guidelines on server resources or you don’t have access to the server, this tutorial will give you options for uploading large files.
How to Find The Maximum File Upload Size in WordPress
Before you begin, a good thing to check is the maximum file upload size that your website will allow. To do so, navigate to the Media Library as if you were going to upload a file. Click Add New and you’ll see a notice of what the maximum file upload size is. In this case, it’s 128 MB.
Upload Large Files to WordPress Using FTP
The first method we’ll unpack uses FTP. FTP (File Transfer Protocol) creates a direct link to your computer and a server, allowing you to move files between them. Two popular FTP clients exist, they are FileZilla and CyberDuck. Both of these programs are free to download.
Once you’ve got an FTP client up and ready to go, you can access the website’s server. For this, you’ll need server details like the host, username, password and port.
If you do not have server access or are looking to expand the upload limit for a client, jump to the Big File Uploads method.
Step 1: Connect to the Website via FTP and Upload the Media File
Once you have connected to the web server via FTP, you will want to navigate to the WordPress site’s Uploads folder. Typically, the Uploads folder resides under wp-content >>uploads>>year>>month and the path will look something like this: /yourwebsite/wp-content/uploads/2021/07.
Depending on what month you would like the media file to be nested under, select based on your needs. Typically this will be the most current month, but you may have the need to organize in a past folder.
Now that you have accessed the site via FTP and located the desired Uploads folder, it is time to add your media. The file that I am going to upload is a 9.2MB image from unsplash.com.
Under normal circumstances, you definitely would’ upload an image of this size to your website. You’d crop it, compress it and format it for web to make sure that the image file size is as small as possible, but for this tutorial, the goal is to upload large files to the Media Library.
To add the image, make sure that the proper Uploads folder is selected and then simply drag and drop the file onto the FTP client. In this case, using FileZilla, I dropped the folder where it says “Empty directory listing” in the image above.
Now that the file is added you will see it in the uploads folder on your server.
Step 2: Install the “Add From Server” Plugin
With Step 1 complete, the desired media file resides on the server and is in the proper uploads directory. This all seems good and well, but there’s a problem, that the media file won’t appear in the WordPress Media Library by default unless it is added using the native media uploader. In this case, since we were unable to add the file using the normal method, we have to take more steps for it to appear in the Media Library.
As you can see in the image below, I do have some goodies in my Media Library, but the image I added via FTP of a starry night and some mountains is missing even though it is in the proper uploads folder on the server.
In order to add this file to the Media Library, install the Add From Server plugin either directly from the WordPress plugin dashboard or by downloading it from the WordPress repository. Once it is installed, remember to Activate the plugin.
Step 3: Import the Media File into Your WordPress Library
With the Add From Server plugin installed and activated, you will see a new option under the Media Menu called Add From Server. Click on Add From Server and you will be brought to a screen with several website directories to choose from. In this case, we are going to click on the “Uploads/” directory.
After you click on uploads/ you will then select the year of the folder and then the month that you uploaded to. Once you are in the proper location, you should see the media file that you uploaded via FTP. Select the item and then click “Import”.
Boom, just like that the file is now located in your Media Library and can be used throughout the site in pages, posts, modules, products and more.
Upload Large Files to WordPress By Editing the .htaccess File
Another option for hacking the system is to edit the .htaccess file. The .htaccess file acts as a sort of master file in the WordPress core package. Editing its variables can have tremendous effects on your site, so when doing so, make sure you backup the file first.
It’s important to mention that, because the .htaccess file is such an important one, some hosts may restrict the editing thereof. If you cannot access this file, contact the hosting company directly for assistance.
This method also requires server access. You can either log into the server directly or access it via FTP. Once you’ve accessed the server, locate the site files of the WordPress core package. Within these files, locate the .htaccess file and open it. Once you’re inside, add the following lines of code:
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
Upload Large Files to WordPress By Editing the php.ini File
Another method for changing the file upload size to allow for large uploads is to edit the php.ini file. Again, you’ll need server access either directly through the server itself or via FTP. Similar to the .htaccess method, altering the php.ini file may not be allowed by some hosts.
Once you’ve located the file, add the following code:
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
Upload Large Files to WordPress Using the Big File Uploads Plugin
All of the methods mentioned above require server access, and in some cases, you may not be able to edit the files on the server at all. So what do you do if you don’t have access or experience a timeout error? In this case, you could use a plugin such as Big File Uploads.
Available as a free download from the WordPress repository, Big File Uploads from Infinite Uploads helps you bypass the upload limits set by your host, letting you increase the maximum upload size to as large as your available disk space allows. With an increased upload size, you can add large media files to your Media Library and carry on building your website.
The plugin works by enabling multipart uploads. Instead of uploading a single file at a time, a large file will be uploaded in segments or chunks. Once all of the small pieces of the file are uploaded, the plugin will combine them together again before they reside in the Media Library. By uploading files in segments, or chunks, with Big File Uploads, you won’t experience any timeout errors or hassles. This is major, as using other methods like changing the php.ini file may cause issues in this regard.
At the time of writing, Big File Uploads has over 40,000+ active installations and is updated frequently.
To begin, head over to the WordPress Plugins dashboard and search for Big Uploads. Alternatively, download the plugin from the WordPress repository and upload it to your site.
Once the plugin has been installed and activated, it’ll create a new menu item in the Settings menu. All of the plugin’s settings can be configured from this single panel.
Changing the file upload size
First, the plugin will automatically detect the site’s default file upload size as defined by the host. To change this, adjust the number counter and select whether you’d like the limit to be set in either GB or MB.
The plugin also offers a rough guideline of the maximum size you can set. This value is estimated based on the remaining space in the server’s temp directory. You can increase this value by offloading to a paid storage service from Infinite Uploads. More on this later.
Setting custom upload size limits for each User
Another great aspect about Big File Uploads is that it allows you to set a custom file upload size for each user role on the site. If you have multiple people working on your site, for example, editors and authors who are running a blog, by limiting their file upload size, you can rest assured knowing they won’t be able to upload large files, like images that are 9MB each.
Next to the “Customize by user role” notice is a toggle, and when toggled on, you’ll see a list of the available user roles pop up, each with its own file upload size counter. Here, you can set a custom size for each role.
Storage usage scan
An awesome feature included in the plugin is the storage usage scan.
At any point, you can scan your Media Library and get insight into how much storage space you have left. If you see that you’re running low, you could purchase cloud storage from Infinite Uploads.
Big File Uploads Drawback
Big File Uploads has a few limitations. This will not work to increase the upload limit of files being uploaded from the front end of your website because these tools do not use the same upload method as the WordPress media library. If you are using a plugin or extension to allow users to upload from the front of your website you will need to consider a different method.
The only other drawback is big files use a lot of space and resources. If you are not storing your media files in the cloud, big files can slow down your servers and impact site performance.
Unlimited storage from Infinite Uploads
If you want to move your Media Library’s files totally offsite, you can purchase a membership from Infinite Uploads and use their cloud storage service. Moving all of your images, videos, audio files and so on away from the Media Library will save bandwidth and will keep your website running fast. Also, you’ll never be restricted by file limits as set by your host.
Using Infinite Uploads’ storage service, you’ll get access to a cloud-based storage system for your media files. Even though your content is stored in the cloud, you won’t have to worry about using FTP or gaining server access, as you’ll be able to use the WordPress Media Library as per normal. Your image, video, audio and PDF files will still display as if they were in the Media Library, however they’re actually offsite, in the cloud. Files are transferred to and from the cloud using encrypted SSL and other high-end security solutions, meaning your content is safe and secure at all times.
Unlike most services that make you pay per plugin or per site, with Infinite Uploads, you only pay for your storage. Plans are really affordable too, beginning as low as $9 per month for 20GB of storage and 20GB of CDN delivery. The Infinite Uploads CDN has over 50 data centers, making sure your content is served to your customers at lightning speed.
If you need to make your site infinitely scalable you should check out Infinite Uploads. Infinite Uploads offers a 7-day free trial to all new users so you can try it risk-free. Sign up for a free trial.
Ending Thoughts
Web designers and developers are faced with all kinds of different scenarios and obstacles on a daily basis. The beauty of working with a dynamic CMS like WordPress is that there are many tricks and tools available.
If you need to upload large files to your WordPress Media Library, there are many methods available to you, some using more technical methods, others using nifty plugins such as Big File Uploads and additional storage from Infinite Uploads.
If you have any questions or comments, please feel free to leave them below. We love receiving your feedback! Thanks for reading!
Thanks I had an idea now ! Great article , Uploading file sometimes it’s not easy because it had some error when I try It! 🙂
Hey Cory. You provided such a great informative article. You have described all the methods properly and I am so glad that I found this article. I have tried going through the other articles to update the php.ini file but that didn’t work for me. Thank You so much.
So glad it worked for you! Let us know if you need any other help with your big files.
WOW… Thanks a lot, you the best. this really solves a lot of problems for me. Very helpful article
Couldn’t believe this could just help solve this frustrating WP upload limit issues that easily until I tried it and it worked seamlessly. Amazing guide
This was really helpful when working to add content to woocommerce as it requires not just link but the media to be in the media files folder.
the plugin solved just that.
Thanks.
Is there an upload limit to the server? tried adding a 600mb video file and it wouldn’t let me. Or is it just my computer?
So glad I found this, I tried the other recommendations to update the php.ini file but this didn’t work for me. Great helpful article thanks.
Hi Cory, great article. With the methods you describe, do the ALT tags apply? Sorry if this question seems arbitrary.
So after I use the plugin (having to import videos) can I un-install it?
Or is it best to just use the url to the video and not worry about seeing it in the media manager?
Hello, yes if you do not think that you will be using t he plugin on a regular basis you can uninstall it and the item will remain in the library.
If you are familiar with uploading media and linking to the server URL than that is the ideal method… this method is for people who may not have that knowledge or need the item in the library for a client to use, for example.
Thanks!
A real gem, I had no idea about the Add From Server plugin, thanks!
glad you found this useful… thanks!