Here's how to exclude specific directories from Spotlight to improve your privacy.


Imagine for a second: some directories (or folders) on your computer contain sensitive information. You don't want other people to have easy access to these directories, but unfortunately with Spotlight, anyone with access to your desktop can easily unearth the files and the information they contain.

It is a problem.

For very sensitive folders, it is best to outright encrypt these directories. But for less sensitive information, encryption can be overkill.

Maybe you also have so many files and directories on your desktop that Spotlight search isn't as fast as you'd like.

Either way, to fix these issues, you can prevent Spotlight from looking for specific directories on your local drive. As Spotlight is very powerful, it can present several results very quickly. This means that a malicious actor can quickly locate the files they need to commit their misdeeds.

With this Spotlight trick, you can prevent intruders from finding such files too easily.

Exigences

All you need to do this is an up-to-date macOS device and a directory (or more) that you want to exclude from Spotlight search.

   1.Hide directories from Spotlight
Open System Preferences
Click the Apple icon on the left edge of the top bar, then select System Preferences.

   2.Open Spotlight preferences
In the System Preferences window, click Spotlight.

   3.Open the Privacy tab
Click the Privacy tab, then click + (the plus sign).



   4. Exclude directories

In the pop-up that appears, locate and select the directory you want to exclude from Spotlight, then click Choose.


Once you hide these directories from Spotlight, their contents should no longer appear in search results. The only thing to keep in mind is that Spotlight may take a while to "forget" these folders. macOS isn't very quick at forgetting directories, and even a reboot doesn't speed up the process. However, these directories will eventually stop appearing in the results after a while.

A bonus Spotlight tip

Return to the Spotlight Preferences window and click on the Search Results tab. From there, you can include or exclude certain categories of files from Spotlight search. Again, be aware that once you've made changes, Spotlight will take some time to forget about these categories.



With these two little tricks, you can make it much harder for others to locate your private files and information.