How to remove "where from" xattr data from image files downloaded in Mac?

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!


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

Or:

xattr /path/to/filename