MacOS – Spotlight Privacy

macosprivacyspotlight

Is there a way to tell Apple's content indexer to ignore a folder and its children by creating a file (similar to robots.txt) in the root of the folder to be ignored?

I don't want the folder to be listed in the privacy pane of system preferences since that's the first place someone who knows would go to look for "private" files.

Benefits of NOT using the system-preference panel:

  • More transportable – an ignore setting in an external drive that moves between computers would be easier to maintain
  • More private – listing a file to be ignored in a preference panel is hardly private

Is there a way to use a (slightly-more-stealthy .spotlight) settings file?

** edit **

Yes, I realize that this isn't a perfect solution, but it's good enough for my purposes.

Best Answer

This answer to How can I make spotlight ignore certain file types and directories? appears have the solution:

$ cd DIRECTORY
$ touch .metadata_never_index