This tool removes old flat keywords (e.g., Make:Porsche, Model:911GT3, Num:73) from your racing photos while preserving:
- ✅ New hierarchical keywords (
AI Keywords|Make|Porsche) - ✅ Manual keywords (track names, customer info, event names)
If you previously ran Racing Tagger with the old flat keyword format and have since migrated to hierarchical keywords, you'll have duplicate keywords in your files. This tool cleans up the old ones.
Three batch files are provided for drag-and-drop operation:
Use this first! Shows what would be removed WITHOUT modifying files.
How to use:
- Drag and drop a folder (or single file) onto the
.batfile - Review the output - it shows what will be removed and what will be kept
- Check the log file for complete details
Removes old flat keywords from your files.
How to use:
- Run dry-run first to make sure you're comfortable with the changes
- Drag and drop the same folder onto this
.batfile - Type
yeswhen prompted to confirm - Wait for completion (545 files takes ~7 minutes)
- Check the log file for results
Safety: Asks for confirmation before making changes.
Test the cleanup on a single file with automatic preview.
How to use:
- Drag and drop a single image file onto this
.batfile - Review the dry-run preview
- Type
yesif you want to clean that file
- Python 3.10+ - Must be installed and in PATH
- exiftool - Must be installed (automatically detected in
C:\WINDOWS\exiftool.EXEor PATH)
- Download from https://exiftool.org/
- Rename
exiftool(-k).exetoexiftool.exe - Copy to
C:\WINDOWS\or add to PATH
Old flat auto-generated keywords:
Make:Porsche,Make:BMW, etc.Model:911GT3Cup,Model:Cayman, etc.Color:Black,Color:Blue, etc.Num:73,Num:911, etc.Class:SPB,Class:SPC, etc.Error:*,Sequence:*,People:*,Subcategory:*,Engine:*Classified,NoSubject
- Hierarchical keywords:
AI Keywords|Make|Porsche,AI Keywords|Model|911GT3, etc. - Manual keywords:
Customer,Porsche Club of America,PCA Club Racing,Racetracks|Road America, etc.
Each run creates a timestamped log file in the same directory:
- Example:
cleanup_keywords_20260103_202329.log - Contains detailed information about every file processed
- Shows exactly which keywords were removed from each file
If you prefer command line:
# Dry run (preview) - this is the default, no flag needed
python cleanup_old_keywords.py "C:\path\to\images" --verbose
# Real run - requires --live
python cleanup_old_keywords.py "C:\path\to\images" --live
# Single file (dry run)
python cleanup_old_keywords.py "C:\path\to\image.jpg"- Dry-run by default - the tool never modifies files unless you pass
--live - Confirmation prompts - Prevents accidental execution
- Detailed logging - Track exactly what was changed
- No backup mechanism - removal uses
-overwrite_originaland is permanent; keyword classification is by string prefix, so a manually-typed keyword sharing a prefix (e.g.Class:VIP-pass) looks identical to an auto-generated one and will be removed. Always check the dry-run output and the log file before running with--live. - Idempotent - Safe to run multiple times (won't break already-cleaned files)
- No backups created - Uses exiftool's
-overwrite_originalflag (original files are modified directly)
- Python is not installed or not in PATH
- Install Python 3.10+ from https://python.org
- Make sure "Add Python to PATH" is checked during installation
- exiftool is not installed
- Download from https://exiftool.org
- Copy
exiftool.exetoC:\WINDOWS\or add to PATH
- Your files are already clean! ✅
- Or they never had the old flat keywords
- In Lightroom, select the photos
- Go to Metadata → Read Metadata from Files
- This forces Lightroom to re-read the cleaned metadata
INFO - Found 545 files to process
INFO - ------------------------------------------------------------
INFO - [DRY RUN] 2025-09-01-PCA Rd America-00027.JPG
INFO - Removed 4 auto-generated keywords:
INFO - - Color:Black
INFO - - Make:Porsche
INFO - - Model:911GT3Cup
INFO - - Num:37
INFO -
INFO - ------------------------------------------------------------
INFO - Processing complete:
INFO - Files processed: 545/545
INFO - Files modified: 498
INFO - Total keywords removed: 2363
INFO - Total keywords kept: 8722
INFO - Failed: 0
See the main README.md for more information about the Racing Tagger project.