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.

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

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

13 Comments

» Comments RSS Feed

  1. Mashito says:

    I have a few folders excluded, heh

  2. Jesse says:

    FYI, ModMyI.com stole your post

  3. Sue Dunham says:

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

  4. bap says:

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

  5. [...] 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 [...]

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

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

  9. Martin Schabbauer says:

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

  10. prasad says:

    thanks…
    good job….

  11. [...] 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 [...]

  12. 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??

  13. 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…

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

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