ExifTool, clearly: how to remove metadata from the command line
If you have looked seriously into removing a photo’s metadata, you have come across ExifTool. It is free, has been maintained by Phil Harvey for over twenty years and reads almost any format there is. Here are the commands actually used, what to know before running them and when something else is worth it.
Seeing what a file carries
exiftool photo.jpg shows everything. With exiftool -a -G1 -s photo.jpg you also get duplicate fields, each one’s group (EXIF, XMP, GPS…) and each tag’s short name, which is the one used to delete it. To see only the location: exiftool -gps:all photo.jpg.
The commands to remove it
- Everything:
exiftool -all= photo.jpg. It leaves a copy of the original asphoto.jpg_original; with-overwrite_originalit does not. - Only the location:
exiftool -gps:all= photo.jpg. - Everything except what is needed to view it properly:
exiftool -all= -tagsfromfile @ -orientation -icc_profile photo.jpgdeletes everything and writes back the orientation and colour profile. - A whole folder:
exiftool -all= -r folder/, subfolders included. - Checking the result: run
exiftool -a -G1 -sagain on the clean file. ExifTool does not do it for you.
The catches
- Deleting the orientation rotates the photo. Many phone photos are stored sideways and display upright thanks to a metadata value. With a bare
-all=, they may come out rotated. - In a PDF, deleting is not deleting. ExifTool’s own documentation warns that its PDF edits are reversible: it appends an update at the end and the earlier data stays inside the file. To really get rid of it, the PDF has to be rewritten with another tool, such as
qpdf. - The
_originalcopies pile up, and they carry all the metadata you meant to remove. If you share the folder, share it without them. - Indiscriminate deletion dims iPhone HDR photos, because the extra brightness depends on two metadata values.
When something simpler is worth it
ExifTool is the best tool if you work in the terminal, need to automate or want field-by-field control. KillEXIF is made for everything else: you drop the file, see what it says about you in plain words and clean it without re-encoding, keeping the orientation, the colour profile and the HDR. Then it reads the file back to check nothing is left, and for a PDF it rewrites the file instead of appending an update at the end. All in your browser, without uploading anything. And for whole folders without a terminal, the Mac and Windows apps have watched folders.
To check any tool, KillEXIF included, ExifTool is exactly what we use ourselves: it is the independent second opinion in our tests.