How to Export Photos While Maintaining Folder Structure

If you’re looking to export multiple images organized into folders while preserving the folder structure, there’s a plugin that can add that capability to Lightroom.

Last Updated:

If you’ve got your photos organized into folders on your hard drive or external disc, there are situations where you might want to export files from multiple folders while preserving the folder structure for the exported files. Maybe you’ve organized them by date, with folders for years and months and subfolders for days. Or maybe you’ve got them in folders by location. Or by client. As much as a database system can theoretically render filesystem folders obsolete, in practice a filesystem folder hierarchy still has a lot of value for very many uses.

Lightroom doesn’t have the built-in ability to export files and maintain the original folder hierarchy for the exported files–at least not automatically. And there’s no token in the file renaming panel that can be used for folders–and the file renaming panel doesn’t understand folder structures. (It is possible to create a publish service to the hard drive and then manually recreate one level of folders and subfolders by using publish collection sets and publish collections, but that’s a very tedious way to do it with multiple images, and it only works one level deep.)

But thanks to Jeffrey Friedl, here’s a plugin that can add this capability. It’s his Folder Publisher plugin. It sets up a publish service specifically with the ability to mimic the folder structure of the master images in a set of copies you’re saving elsewhere on your hard drive or external drive.

Lightroom Folder Structure Plugin

Technically, it’s a publish service and is therefore a little more involved to set up than simply checking another box in the export dialog. Even for a one-off task, you’ll still need to configure the publish service. But once it’s configured, it can be reused.

And because it’s a publish service, it also means you can take advantage of extra features like syncing. That can come in handy if you’re looking to replicate the same folder structure but use smaller JPGs, for instance, perhaps to share automatically with clients in real time through something like Dropbox.

It works with all versions of Lightroom since Lightroom 3, although there’s the occasional distinctive feature that only work with specific versions of Lightroom. As usual with Jeffrey’s plugin’s, it’s licensing system is based on donation-ware. So donate what you can or wish to get unlock the fully functional version.

Using collections instead of folders? The same developer has a closely related plugin that works on collection structure instead of folder structure. You can find it here.

Here’s a quick rundown of how it works:

Folder Publisher Plugin Options

Download and install the plugin as you would any other plugin. Make sure to add it through the Plugin Manager so that it’s active. The interface through the Plugin Manager looks like this:

Lightroom Folder Publisher Plugin Main Panel

Close out of the Plugin Manager and return to the library module. At left, in the title of the Publish Services panel, click the + icon.

Lightroom Folder Publisher Publish Service Add

The next step is to configure this publish service by working down the panels in the Lightroom Publishing Manager screen. You’ll notice there are more options than a bare-bones publish service has. I’ll focus on the unique ones below.

Lightroom Publishing Manager Panel Options

Give it a unique name in the Publish Service description field.

The Publish Tree field is where you want the folders and files to be stored. This will be the top-most folder, with the rest of the folder hierarchy being replicated below it.

Lightroom Publish Tree Root

The File Date/Time Options panel lets you override the standard operating system date. By default it’s unchecked, but you can change that behavior. This has potential ramifications if you’re using some kind of file syncing or backup that looks for times that files were created and modified.

Lightroom Folder Publisher Date and Time Options

The Smart Preview options control whether smart previews can be used instead if the original master file is missing or offline (maybe on a network drive or external hard drive, for instance).

Lightroom Smart Preview Folder Publisher

The republish triggers option controls the behavior when you modify information about a photo. That is, whether or not it’s marked to republish if you update something like the caption or the rating. You might want to republish the image when you update the caption, for example–or you might not. While many publish services offer a variation on this, the one here is unusually granular and offers more fields that can be used.

Lightroom Publish FOlder Metadata Triggers

The enhanced file renaming tab gives you more control over the automatically generated filenames through using an expanded list of tokens. There are a lot of ways to use this. Check out the plugin’s documentation for the tokens and how they interact with each other.

Lightroom Publish Folder Enhanced File Renaming

The delete options panel controls whether or not to orphan exported copies if you move or delete the original masters. This might be useful if you’re creating JPGs for purpose that doesn’t require keeping the RAW masters, for example.

Lightroom Publish Folder Delete Options Panel

You an even set up FTP sync, taking the new copies of the images and uploading them (and their folder hierarchy) to an FTP server. This is very useful if you need automated, fast delivery of files via FTP, maybe to a news photo agency or even your own website.

Lightroom Publish Folder FTP Sync

And, finally, there’s the option to import the plugin’s publish service settings so you can do it once and don’t have to go through all of these options every other time you set up a similar publish service.

Lightroom Publish Folder Settings Import


Once the publish service is created, it appears in your left panel of the library module along with the other publish services. You can then simply drag your photos from the grid onto the panel.

One thing that’s a little disconcerting at first is that the folder structure isn’t recreated as collections or collection sets. All of the images go into the one folder in the publish service panel. That’s because the separating out into the folder structure actually happens when the images are published.

Lightriin Publish Folder Drag and Drop

So don’t worry that you’re not seeing the folders created here–they’ll be created when you actually publish the photos.

As with all of the Lightroom’s publish services, just dragging the photos onto the publish service’s panel doesn’t actually export or publish them. It puts them into a kind of virtual staging area. To publish them, you have to hit the Publish button at top right.

Lightroom Publish Folder Main Panel

Then, once it’s published, you can go into your hard drive’s filesystem and see the results. In this example, I had the original images organized into date-based folders. This screenshot shows the published results:

Lightroom Publish Folder Results

Here’s a different example, with an extra layer of depth and file renaming:

Lightroom Folder Publish Results 2

Things to Note

Parent Folders. Something that’s important to know is that the folder structure is based on the folder structure that Lightroom sees in its Folders Panel. That doesn’t always match the actual filesystem folders exactly when it comes to parent folders because you can hide or show parent folders. By default, Lightroom likes to try to keep things tidy and clean, so it doesn’t usually include all the high-level parent folders. To hide or show parent folders, right click on the highest-level folder in the Folders panel and choose show or hide parent folders from the popup menu.

Folders in Publish Panel. I mentioned this above, but don’t be concerned that the folders aren’t being recreated as collections and collection sets in the Publish Service panel. All of the images go into a single, flat collection there. The sorting into folders happens when you hit the Publish button.

Where to Get It

You can download it directly from the developer’s website. It comes as a time-limited and number-limited free trial. To unlock it, you’ll need a donation-ware license (ie. donate what you think is reasonable via Paypal to get the license key).

David Coleman

I'm a freelance travel photographer based in Washington DC. Seven continents, up mountains, underwater, and a bunch of places in between. My images have appeared in numerous publications, and you can check out some of my travel photography here. I've been using Lightroom for years, from back before it was Lightroom (RawShooter). More »

4 thoughts on “How to Export Photos While Maintaining Folder Structure”

  1. hello, i installed jfriedl’s collection publisher following your guidelines and directed that the jpgs be saved to a second internal drive however there are no folders, only images. my LrC collections has a root folder called “my collections” which i clicked, then pressed g for grid view and then command a to select all and then dragged them over the folder with the double arrows below his name just as you did in your illustration. it took a day for the many thousands of images to convert and show up on the new drive but no folders. i even went back to the lightroom publishing area and clicked publish again, but still no folders. besides no folders it looks to me that many of the images are not from collections, but from folders. i’m using LrC 10.1 and mac big sur. thanks

  2. Using Lightroom to post-process photos I have been looking for a way of backing up those that I have processed. Your guide to Exporting Photos whilst maintaining Folder structure is exactly what I was seeking having installed jf Folder Publisher. Great explanation which I managed to follow (Thank you!!) until it came to trying to actually add photos to be ‘published’…….totally lost.
    If you have a moment to help I would be so so grateful :)


Leave a Comment