How to scrub sensitive photo metadata using ExifTool

Protect your privacy while retaining image settings

22 Jan 2017

Modern cameras store a lot of information in each photo: important stuff like the shutter speed and camera model, but also less well known things like your location and the serial number of your lens.

When I made the photo gallery on this site, I wanted to remove metadata that identifies specific devices I own or people I know. But I didn’t like the idea of removing the capture settings too, since those might be useful for other photographers. (This is also why I don’t minify this site.)

I’m now using the following ExifTool command on all photos before I share them. It’s in my .bashrc to make things more convenient:

alias exifscrub_destructive="exiftool -overwrite_original -LensIDNumber= -SerialNumber= -LensSerialNumber= -ShutterCount= -Keywords= -Subject= -ThumbnailImage= -PhotoshopThumbnail= -XMP:All= "
# usage: exifscrub_destructive *.jpg

Here’s what each option means:

These options worked on photos from my Nikon D5100. Your camera might store things differently, so please let me know if I missed anything!

Update on 30 May 2017: Add -LensSerialNumber= argument.