Tutorial · images · Published 2026-08-16 · 4 min read
Remove image EXIF metadata
Remove EXIF metadata from website images: why it matters for privacy and file size, and how to strip it at export, with a tool, or in a pipeline.
What EXIF is and what it carries
EXIF (Exchangeable Image File Format) is the metadata block a camera or phone writer embeds in a JPEG (and, in a smaller form, several other formats). It holds shutter speed, aperture, ISO, focal length, the lens, and usually the camera model and serial. Modern phones also write GPS coordinates into the file.
Make: Pixel 9
GPS: 52.2053N, 0.1218W
CreateDate: 2026-07-03 10:12:42
Software: Adobe Photoshop
The file size cost is small (a few KB of a multi-MB image), but the privacy cost is real when you publish a personal photo that a visitor downloads or right-clicks and inspects.
Why strip it
- Privacy: an image with GPS and a device serial tells a visitor more than the picture itself. A staff photo or a client office shot with embedded GPS can expose a location you would not print in the footer.
- File size: stripping metadata is a tiny saving but a free one; re-encoding (which removes EXIF anyway) is where the real size-saving happens.
- Compliance and brand control: if a client's site published a photo with the original camera serial or a contributor's personal data, the removal is an operational hygiene step, not a creative one.
Strip it three ways
1. At the source, in the export dialog
Every photo editor (Lightroom, Photoshop, Affinity, Snapseed on mobile) has an export option that removes EXIF. In Lightroom's Export screen, set Metadata: Copyright Only or Remove all metadata and the GPS serial goes away before the file exists.
2. With a one-line tool
exiftool is the direct, scriptable way, and there is no GUI to fight:
exiftool -all= -overwrite_original photo.jpg
This strips everything including GPS, thumbnail, and software; the -overwrite_original removes the backup copy so you do not accidentally serve the untouched original. On a folder of images in one go:
exiftool -all= -r -ext jpg -ext jpeg -overwrite_original ./images
3. In the image pipeline and CMS
When images are processed by a converter (the compression pipeline article sets it up), the re-encode itself drops EXIF, because the output format the pipeline writes retains only the fields you explicitly copy. Add the strip step to the pipeline command so every future upload is clean without a manual step.
In WordPress the behaviour is uneven and worth knowing about:
- With the GD image editor (most shared hosts), WordPress strips EXIF and IPTC by default, so your resized sizes are already clean, but the uploaded original keeps its metadata if the server simply stores the file it received.
- With the Imagick editor, WordPress strips metadata from resized sizes too (unless you disable the
image_strip_metafilter), and again the original upload keeps its EXIF. - The original full-size file in the Media Library is the one that leaks GPS; that is the file to strip, either with
exiftoolbefore upload or with a small upload filter that drops the metadata when the file is stored.
Design the strip habit
- Batch before upload: run the strip over a media folder the day it is exported, not per file later.
- Verify with
exiftool photo.jpg(no metadata lines underGeoorMakerNotes) or an online EXIF reader that shows the empty block. - Do not strip on a file whose metadata you need: aperture and shutter for a camera-spec gallery. Keep an originals folder and strip only the served copies, which is what the image optimisation workflow does for variants.
The rule is a pipeline rule: the strip belongs at the point the file is clipped for the web. The format/compression guide is the place the strip habit lives, because a web JPEG and a camera JPEG have nothing in common except the file extension.