How to Strip Photo Metadata in the Terminal with exiftool

If you want to strip metadata from photos (e.g., location data from your phone's GPS), there are a few ways to do it:

  • On iOS, I recommend Metapho.
  • On Mac, you can use the built-in, and there are lots of apps in the App Store of dubious quality that do this.

There's another option for Mac if you want to use the Terminal: exiftool

You can get exiftool with brew install exiftool, and then you can use this command to strip all the metadata from a photo:

exiftool -all= /path/to/file.jpg

You can verify that it worked with exiftool -a /path/to/file.jpg | grep GPS. Try running this before and after the previous command, and you can see how the GPS info is removed.

I have added the following to my .zshrc file for quick access to these commands:

alias exifstrip='exiftool -all='

function exifgps(){
    exiftool -a "$1" | grep GPS