Hide Anything from Spotlight in Mac OS X with the Library Folder
Though you can add anything to Spotlights Privacy list to prevent indexing of that folder or file, the obvious problem with that approach is the file or folder is shown within the Spotlight control panel in Mac OS X, making it easy for someone else to find the excluded items.
Another way to hide a file from Spotlight is to drop it in the user Library directory. This makes it invisible to the vast majority of people, and it also prevents the file from being indexed by Spotlight despite not being directly excluded. This works because Spotlight does not index the user Library directory which is typically just filled with preference and cache files.
- Get access to the Library folder in OS X, using Command+Shift+G to ~/Library/ is my preferred method
- Drag & drop a file or folder in the users Library directory
- Optional: add a layer of obfuscation by creating a boring sounding directory in ~/Library/, such as “Webkit Data”, and store the file or folders to hide in there
You can immediately confirm the file or folders contents are hidden from Spotlight by hitting Command+Space and entering the files name, it will no longer be found.
Just remember that if you keep the Library folder visible then your hidden file or folder may be easily found by prying eyes, though the nonsensical folder name may deter that. You can always follow one of the many other methods we’ve covered to hide things in OS X, ranging from hiding files with chflags, by placing a period in front of the folder name, and using visually invisible folders. Ultimately the safest approach is to password protect an encrypted disk image and store private documents and data there.