How can you delete only GPS metadata from a jpeg file?

I (think I) can delete all GPS information from jpeg file's metadata by

exiftool -gps:all= -xmp:all= filename.jpg

but that deletes all XMP metadata. Is there a way to delete only GPS information from XMP metadata (and from any other metadata group) by not designating individual GPS tags separately?


Solution 1:

exiftool -gps:all= -xmp:geotag= image.jpg

deletes only GPS tags in Exif metadata and XMP metadata, but might not delete all XMP GPS metadata at least by old exiftool. If you want to be sure that all GPS information will be deleted, and it does not matter if all XMP counterparts of Exif data will be deleted, replace -xmp:geotag= by -xmp-exif:all=. (Note that there might also be other location information in metadata besides GPS information, even in IPTC metadata.)