How to Exclude Hard Drives and Folders from Spotlight Index in Mac OS X

Dec 30, 2011 - 13 Comments

Exclude from Spotlight Spotlight is a wonderful feature of Mac OS X that lets you quickly find literally anything on a Mac by search, that includes files, apps, folders, emails, you name it, and Spotlight will find it, but sometimes you don’t want everything to be indexed. Whether that’s an external backup drive, a scratch disk, a directory of temporary items, or just a private folder with files you don’t want easily found through the search function, you’ll find that excluding drives, files, and directories from Spotlight is actually very easy.

Exclude Specific Items from Spotlight Indexing

This is by far the simplest way to universally exclude something from Spotlight searches and it works in all versions of Mac OS X:

  • Launch System Preferences from the  Apple menu and choose the “Spotlight” preference panel
  • 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

Items dragged into the Spotlight Privacy window will then appear as a list within the Privacy section:

Exclude items from Spotlight index

Excluding Hard Drives from Spotlight Index

Think of the Privacy tab as an exclusion list, anything appearing in this list indicates that it is now excluded from the Mac OS X search function. This makes it really easy to prevent a hard drive from being indexed by Spotlight, because to exclude the entire drive you just have to add it to the list as shown here:

Exclude drives and folders from Spotlight index

Whatever folder or drive in that list is effectively hidden from the Spotlight index, making the contents not be indexed, and not appear in any file searches, whether it’s from the primary Command+Spacebar Spotlight menu, or Finder-window searches. This is a much better approach than disabling Spotlight if all you want to do is hide certain files from prying eyes. Additionally, if you don’t want Spotlight to run when you plug in an external hard drive, you can just add it to that list to have it not be indexed (of course, that means it won’t be searchable with Spotlight though too).

Re-Adding Items to Spotlight Index

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 again, and when finished the once excluded files will be searchable in Mac OS X again.

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, particularly if you find a file or folder isn’t showing up when it should be.


Related articles:

Posted by: Paul Horowitz in Mac OS, Tips & Tricks


» Comments RSS Feed

  1. annoporci says:

    I’ve added my SD card to the spotlight exclusion list, but it periodically disappears from it, presumably because I keep it dismounted most of the time, spotlight does not see it and then removes it from the list of excluded items…

  2. Matt says:

    So basically all someone has to do to see your “hidden” files is go into the spotlight preferences and see which folders are excluded from the search and double click on them. Is there another way to do this??

  3. […] advice is to drag the items to exclude from indexation into the Spotlight system preference panel exclusion list. That’s the recommended approach because it’s simple to use and easy to manage, but […]

  4. prasad says:

    good job….

  5. Martin Schabbauer says:

    Great – now I understand how to exclude folders from getting indexed. Thanks.

  6. […] 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 […]

  7. […] solution is simple enough, the same method used to exclude something from Spotlight can also be used to stop Spotlight from indexing a Time Machine drive or other external […]

  8. […] if an item is left under the “Privacy” list, it will exclude from Spotlight indexing […]

  9. […] you want to truly hide the folder and it’s contents, take an extra step and exclude the folder from Spotlight indexing. This makes sure that none of the files inside of it can be found through the Spotlight […]

  10. bap says:

    problem is with indexing of cd’s, which makes it difficult to copy items until the full disk has been indexed

  11. Sue Dunham says:

    Thanks. I hated having duplicate items from my back-up.

  12. Jesse says:

    FYI, stole your post

  13. Mashito says:

    I have a few folders excluded, heh

Leave a Reply


Shop on and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site