One Script to Delete Them All: Clean up Lightroom Preview Catalogs using PowerShell
If you're like me and keep one Lightroom catalog per event or photoshoot, your system can easily accumulate dozens or even hundreds of preview folders. Over time these *Previews.lrdata directories grow huge, eating up SSD space and slowing down backup processes. And while Lightroom regenerates previews automatically, it never removes old ones on its own - so they just keep piling up.
Eventually, you’re left wondering:
How much unnecessary disk space are these previews taking - and how can I safely get rid of them all at once?
Good news: There’s a simple, safe, automated solution using PowerShell.
Problem: Lightroom Creates Massive Preview Folders… and Never Cleans Them Up
Lightroom stores previews next to each catalog, typically named like:
YourCatalog.lrcat
YourCatalog Previews.lrdata
YourCatalog Smart Previews.lrdata
If you keep a single master catalog, it might be manageable to delete the Previews.lrdata from time to time. Though you will lose all previews, also ones that you probably currently work on. So this solution shines when you split up your catalogs and only delete older previews.
If you maintain one catalog per client or shooting, like many high-volume photographers do, you may end up with:
hundreds of *.lrcat files
hundreds of *Previews.lrdata folders
potentially hundreds of GB wasted on old previews you don’t need anymore
And because previews are regenerated automatically, deleting them is completely safe - Lightroom will simply recreate what it needs next time you open that catalog.
So the real challenge is not whether you can delete previews…It’s how to delete them efficiently across many folders.
Solution: Delete the *Previews.lrdata Folders
These preview directories are basically caches. Lightroom uses them to display thumbnails and render images quickly, but:
Nothing breaks if they’re deleted
Lightroom will rebuild them when needed
You reclaim a lot of disk space
Backups become significantly smaller and faster
On Windows and macOS, these folders appear just like a file but they are actually packages (Lightroom treats them as special container files with many files inside - one for each preview).
All we need to do is delete them.
Doing it manually, however, takes forever when you have a folder structure like:
Warning: Before playing around with this, make sure you test it thoroughly in your environment first.
(If you want to be sure, comment the line “Remove-Item -Path $($Preview.FullName) -Recurse -Force“ out during your tests)
Automating the Cleanup with PowerShell
Here’s a simple PowerShell script that recursively scans a list of root directories recursively for all *Previews.lrdata folders and deletes them.
# CleanUp-LightroomPreviews
<#
.SYNOPSIS
This script removes for a given list of Folders all
Lightroom Preview Folders (*.lrdata) and reports the
freed up space in MB.
.DESCRIPTION
This script
1. Loops over an array of Folders
2. Searches recursively for all Folders ending with
"Previews.lrdata" (Lightroom Preview Folders)
3. Removes them (with confirmation unless -Force is used)
4. Reports the saved up space in MB
This software is provided ‘as is’, without any warranties
or representations of any kind, whether express or implied,
including but not limited to warranties of merchantability,
fitness for a particular purpose, or non-infringement.
.CHANGELOG
1.0.0 - 2025-11-13 - ms - Initial release.
.PARAMETER LightroomDirectories
List of directories to clean up Lightroom Previews from
This includes subdirectories.
.PARAMETER DebugLogging
This parameter defines the Log Level
.PARAMETER Force
This parameter forces deletion without confirmation
.EXAMPLE
$dirs = @("/Volumes/Backup Disc 3/Pictures2017/", "/Volumes/Backup Disc 3/Pictures2018/")
.\CleanUp-LightroomPreviews.ps1 -LightroomDirectories $dirs -DebugLogging
.NOTES
Author: Michael Seirer (ms)
Email: michael@seirer.net
Requires: PowerShell 5.1+ or PowerShell Core 7+, Windows/macOS/Linux
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, HelpMessage = "List of Directories.")]
$LightroomDirectories,
[switch]$DebugLogging,
[switch]$Force #remove Previews.lrdata without asking
)
Clear-Host
$script:savedSpace = 0
function Write-Log {
param (
[string]$Message,
[ValidateSet("DBG", "INF", "WRN", "ERR")]
[string]$Level = "INF"
)
$timestamp = (Get-Date).ToString("yyyy-MM-dd HH:mm:ss")
$logMessage = "[$timestamp][$Level] $Message"
switch ($Level) {
"DBG" { if($DebugLogging -eq $true) { Write-Host $logMessage -ForegroundColor DarkGray } }
"INF" { Write-Host $logMessage -ForegroundColor Cyan }
"WRN" { Write-Host $logMessage -ForegroundColor Yellow }
"ERR" { Write-Host $logMessage -ForegroundColor Red }
}
}
function Get-FolderSizeMB {
param (
$FolderPath
)
$size = [double]$(Get-ChildItem $FolderPath -recurse | Measure-Object -property length -sum).Sum
$sizeMB = [math]::Round($($size/1024/1024),0)
return $sizeMB
}
function Remove-LightroomPreviewsInternal {
param (
$Preview,
[int]$FolderSize
)
try {
Write-Log " -> Deleting preview folder: $($Preview.Name)" -Level "DBG"
Remove-Item -Path $($Preview.FullName) -Recurse -Force
Write-Log " -> Deleted preview folder: $($Preview.Name)" -Level "DBG"
$script:savedSpace += $FolderSize
Write-Log " -> Already saved $($script:savedSpace) MB" -Level "DBG"
} catch {
Write-Log "Failed to delete $($Preview.FullName): $_" -Level "ERR"
}
}
function Remove-LightroomPreviews {
param (
[string]$Directory
)
$previews = Get-ChildItem -Path $Directory -Recurse -Directory -Filter "*Previews.lrdata"
foreach ($preview in $previews) {
try {
$folderSize = Get-FolderSizeMB -folderPath $preview.FullName
Write-Output "Found $($preview.FullName) ($folderSize MB)"
if ($Force) {
Remove-LightroomPreviewsInternal -preview $preview -folderSize $folderSize
}
else {
$response = Read-Host " Do you want to delete this folder '$($preview.FullName)'? (Y/N)"
if ($response -match '^[Yy]$')
{
Remove-LightroomPreviewsInternal -preview $preview -folderSize $folderSize
} else {
Write-Log " -> Skipped: $($preview.FullName)" -Level "INF"
}
}
} catch {
Write-Log "Failed to delete $($preview.FullName): $_" -Level "ERR"
}
}
}
foreach($d in $LightroomDirectories) {
Write-Log "Processing Directory: $d" -Level "INF"
Remove-LightroomPreviews -Directory $d
}
Write-Log $("Finished deleting Lightroom previews in all catalogs, saved space: $($script:savedSpace) MB") -Level "INF"
This can be called like:
$dirs = @("/Volumes/Backup Disc 3/Pictures2017/", "/Volumes/Backup Disc 3/Pictures2018/")
# in my case, I have one folder per shooting/event and within all needed documents, Lightroom catalogs, exported JPGs etc
./CleanUp-LightroomPreviews.ps1 -LightroomDirectories $dirs -DebugLogging
Now the script does the following:
it takes the array of directories and for each of them, it tries to delete *Previews.lrdata
if the parameter -Force was used, it just deletes them, otherwise it asks first
if the parameter -DebugLogging was used, the Script outputs some more information
A sample script output with -DebugLogging but no -Force parameter looks like this:
...
[2025-11-14 10:44:24][DBG] -> Deleted preview folder: 2020-09-24_Restaurant_M-v13-5 Previews.lrdata
[2025-11-14 10:44:24][DBG] -> Already saved 2000 MB
Found /Volumes/Backup Disc 3/Pictures2020/2020-10-21_SV/2020-10-21_SV-v13-5 Previews.lrdata (163 MB)
Do you want to delete this folder '/Volumes/Backup Disc 3/Pictures2020/2020-10-21_SV/2020-10-21_SV-v13-5 Previews.lrdata'? (Y/N): y
[2025-11-14 10:44:24][DBG] -> Deleting preview folder: 2020-10-21_SV-v13-5 Previews.lrdata
[2025-11-14 10:44:24][DBG] -> Deleted preview folder: 2020-10-21_SV-v13-5 Previews.lrdata
[2025-11-14 10:44:24][DBG] -> Already saved 2163 MB
Found /Volumes/Backup Disc 3/Pictures2020/2020-11-25_Architektur/2020-11-25_Architektur-v13-5 Previews.lrdata (482 MB)
Do you want to delete this folder '/Volumes/Backup Disc 3/Pictures2020/2020-11-25_Architektur/2020-11-25_Architektur-v13-5 Previews.lrdata'? (Y/N): y
[2025-11-14 10:44:25][DBG] -> Deleting preview folder: 2020-11-25_Architektur-v13-5 Previews.lrdata
[2025-11-14 10:44:25][DBG] -> Deleted preview folder: 2020-11-25_Architektur-v13-5 Previews.lrdata
[2025-11-14 10:44:25][DBG] -> Already saved 2645 MB
[2025-11-14 10:44:25][INF] Finished deleting Lightroom previews in all catalogs, saved space: 2645 MB
A word of warning
This script looks for files with the name “*Previews.lrdata” - if Adobe for some reason changes this pattern this script might delete unwanted files.
This script is using Remove-Item CmdLet of Powershell which does NOT put the deleted item in the Trashcan. So there is no way to undo this delete operation
Future Enhancements
This basic script can form the foundation for more advanced maintenance tasks. For example, cleaning up old Lightroom catalogs. For some time, Lightroom creates new Catalog files (.lrcat) for each major version. These are not huge but still unnecessary. The script can delete rather old versions as well.
Conclusion
If you maintain many Lightroom catalogs, preview folders can quietly consume enormous amounts of disk space. Fortunately, they’re safe to delete - and with PowerShell, you can automate cleanup across hundreds of folders in seconds.
This small script can reclaim tens or hundreds of gigabytes, speed up backups, and keep your storage tidy… all with one simple command.