Delete a single extended attribute with xattr -d
Instead of the better-known xattr -c (clear everything), the -d flag surgically removes one named attribute such as com.apple.metadata:kMDItemWhereFroms, the record of where a downloaded file came from.
01Command
$ xattr -l file.pdf
xattr -d com.apple.metadata:kMDItemWhereFroms file.pdf02What it does
The com.apple.metadata:kMDItemWhereFroms attribute stores the download URL of files fetched via browsers and Mail, and Spotlight indexes it. Deleting a single attribute preserves others that apps may legitimately need — for example, quarantine would be wiped by -c, but here only the chosen key is removed. Note that quarantine (com.apple.quarantine) is a separate attribute; removing the WhereFroms key alone does not bypass Gatekeeper.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- xattr — display and edit extended attributesEvidence: Documents -d for deleting a single named attribute and -l for listing attributes.
Last verified: 2026-09-17 · Category: Files & Folders
06Related solutions
List and clear extended attributes — the quarantine flag, Finder tags, and download provenance — on any file.
Use kMDItem attributes to search file metadata the Spotlight UI can't express, faster than find ever will.
Dump every indexed attribute of any file: EXIF, dimensions, duration, authors, content types.