Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Since spotlight continuously updates the index, sometime the file precedence gets changed around and I might type in "saf" and press return expecting to get Safari, but instead spotlight attempts to open some Java jar file.

Question Is there any way to make spotlight ignore certain file types or directories?

share|improve this question
More here… – user21134 Apr 3 '12 at 13:06
up vote 3 down vote accepted

Short answer: yes.

Go to your System Preferences, then Spotlight:

Spotlight Preference Pane

You can disable and/or reorder the items in this list. By dragging Applications to the top, "Saf" will match Safari first (because it's an App, regardless of it's location).

If, on the other hand, there's a Folder(s) or Drive(s) that you want to explicitly exclude from Spotlight until you change your mind, turn onto the Privacy Tab (on top of that panel) and click the (+) button to browse for a folder.

Spotlight Privacy Pane

This window also accepts Drag and Drop of Folders or Drives (Volumes). In my Sshot, you can see that I exclude Clone (my weekly clone drive) from Spotlight so when I search for something I don't come up with duplicated results (one from the main drive and one from the backup).

I also have added a Public Folder where a lot of ppl drops stuff and I don't care about it nor I want it in my search results.

If you want to restore it, you can always remove it from this list (and give spotlight time to re-index it).

You can't (as far as I know) exclude by File type.

Note: in order to drag a "drive" just go go the finder, click on your Mac OS Volume and then press ↑ (the up arrow) to go back to the "root", you will see your volumes there (among other things). Drag it and drop it onto this Privacy tab and voilá.

share|improve this answer

There is a way to exclude folders: add a .no_index extension to the file or folder name.

But my favourite one is adding a .metadata_never_index file to a folder. Use the following command:

$ touch .metadata_never_index
share|improve this answer
Is it .no_index or .noindex? I find online sources that mention .noindex, but nothing mentioning .no_index. e.g.,,…,, – D.W. Sep 21 '15 at 18:49

Not being able to exclude by file type is really annoying. This source claims that if you append .noindex at the end of the filename that file is excluded by safari indexing. I have not been able to verify this trick, but could be interesting for others to try it out.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.