How to Exclude Hard Drives and Folders from Spotlight Index in Mac OS X
Spotlight is a wonderful feature of Mac OS X, but sometimes you don’t want it indexing everything. Whether it’s an external backup drive, a scratch disk, or just a private folder with files you don’t want easily found, excluding drives and directories from Spotlight is easy:
- Launch System Preferences from the Apple menu and click on “Spotlight”
- Click on the “Privacy” tab
- Drag & drop folders or drives to exclude from the Spotlight index, or click the “+” plus icon in the corner to manually select hard drives or directories
Anything folder or drive in that list is effectively hidden from the Spotlight index, making the contents not appear in file searches.
This is a much better approach than disabling Spotlight if all you want to do is hide certain files from prying eyes.
If at any point you want these items to be reindexed and reincluded within Spotlights search results, all you need to do is highlight them in the privacy tab and delete them with the Delete key or by hitting the “-” minus button in the lower left. Removing items will trigger the mds and mdworker processes to run.
On a side note, because excluding items and then reincluding them also causes that directory or drive to be completely reindexed, this can be a helpful troubleshooting tip if you’re running into location specific problems with Spotlight.