Hi so I'm at my wits end coz I am trying to remove xattr data in an image file that is a "Where from" xattr data. This is on a Mojave mac.

This data is written via chrome browser for mac whenever an image is downloaded via this browser.

So I tried this command:

xattr -d com.apple.metadata:kMDItemWhereFroms test.jpg

but it shows the following result:

xattr: test.jpg: No such xattr: com.apple.metadata:kMDItemWhereFroms

How do I remove this data from the image file then? Thanks in advance!

  • That xattr command works for me. BTW You either need to change directory cd ... to, or use the full path to the target file. Also, that error message is appropriate if the target file does not have that extended attribute set. – user3439894 Jul 24 '19 at 16:36
  • Show us that that file with those extended-attributes does exist at that pathname: ls -l@ /path/to/filename. Best to use absolute paths, not test.jpg, it might be picking up some other test.jpg – smci Jul 24 '19 at 21:56

Your command works for me, even copying it and supplying an appropriate filename. As suggested in the comments, you need to ensure that the correct filepath is being supplied, and that the file has the attribute to start with.

You can see whether the file has the attribute in a number of ways:

ls -l@ /path/to/filename


xattr /path/to/filename
  • So thanks, I tried your ls command and here is the result on a test.jpg file: com.apple.metadata:_kMDItemUserTags 42 com.apple.quarantine 57 – sd100 Jul 26 '19 at 2:14
  • @sd100 So it looks like that file doesn't have 'WhereFroms' metadata. You should also be able to check in Get Info in the Finder: the URL of where the file was downloaded will be shown there. If it doesn't have one, then there is no such data! – benwiggy Jul 26 '19 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .