The WordPress file upload screen allows you to insert media images, videos, or audio into your posts either one at a time or as a bulk upload. For the most part, this works great and very few people require anything more. Especially if you’re building up your blog one post at a time and this is the first location you’ve ever had. But what if your library files are already residing elsewhere on your server? What if you have multiple sites and you wish to import the entire library of media from one site into the other? While there is already an “uploads” folder within the “wp-content” directory within WordPress, merely placing a file inside it means nothing. For it to appear amongst the list of media files that you can choose to insert into a post, it needs to be added via the library interface within WordPress.
This presents a problem if you have a large number of media files. Imagine downloading potentially gigabytes of data onto your local PC and then bulk uploading them to WordPress. It’s a waste of bandwidth as well as time. Not to mention that if something goes wrong in between, you have no way of knowing what failed and what succeeded without painstakingly going through the entire list one by one. Needless to say, this is a very poor solution. Fortunately, you can directly add files from the server into WordPress using a simple plug-in.
Using the “Add From Server” Plugin
After installing the plugin, the first thing you want to do is to craft the permissions to decide who gets to upload in bulk. This can be a major operation and you don’t want to give the ability to just about anyone on your site. Moreover, this exposes your directory structure since the plug-in has to navigate your hosting account to locate the files on your server. So unless you’re the only user, this is something you should take care of at the start.
The “Add From Server” options page can be found under “Settings”.
As you can see above, you can open up the functionality to everyone, restrict it to those who have upload permissions within certain rules or in the whitelist box. As a bonus, you can also restrict directory browsing to a specific folder.
Uploading Files in Bulk
Once you’ve set the permissions, you can access the functionality itself under the “Media” menu item from the WordPress dashboard.
Here you can navigate to whichever directory contains the files that you want to upload. A few quick links are provided so you can immediately jump to the uploads folder, the wp-content folder, or the root itself.
In this test example, several versions of an image have been created by WordPress which obviously don’t appear in the library. Let’s use this tool to add them all as well as an audio file which already exists. We’ll see how the plug-in handles duplicates.
Once you click the “Import” button, the process begins. As you can see below, it gives you a confirmation for each file added as well as those that are rejected. For example, the audio file that we included in the first step is skipped over because the library already contains it.
Because all of these files are coming directly from the server, there is no need for any uploading or downloading and the entire process takes place very quickly. As you can see below, all of the sample images have been added to my WordPress library as expected.
I’m thinking that this plug-in could really be of use in a multiuser environment where one person selects images for use by all the others, and places their choices in a specific directory from which the others can pick them up. Especially useful when there are issues of copyright involved and only “safe” images have to be included in posts.