How to prevent Spotlight from indexing files

In addition to using Spotlight's privacy list, a simple name extension can keep Spotlight from indexing specific files and folders.

Apple's Spotlight search technology is a quick way to find files, applications, contacts, and numerous other items on your system, but there are times when you might like to keep some things from being indexed and included in search results.

For example, if you have a collection of outdated program versions in a folder called "past versions," you might wish to keep Spotlight from showing them all, and only have it locate the most recent one that you use. This might also be true for temporary files you have on your system, such as those in the Downloads folder.

For more static locations on the system such as the Downloads folder, you can add these to the Spotlight privacy list in the Spotlight system preferences (either by dragging and dropping, or by using the plus button at the bottom of the list), and they should be excluded from Spotlight's indexing routines.

Folder prevented from being indexed by Spotlight
With the extension "noindex" included, this folder and its contents will not be indexed by Spotlight. Screenshot by Topher Kessler/CNET

While easy enough to do, if you are in the middle of a routine in the Finder and only want to temporarily disable indexing for a file or folder, you can do that, too. Recently OSXDaily outlined an interesting tip, in which you can force Spotlight to ignore a specific file or folder by simply adding a special extension to its name. Simply select an item in the Finder and press Enter to edit its name, and then add ".noindex" to the end, and you should now have a resource that is not indexed by Spotlight.

Undoing this change simply requires removing the extension, and the item will then be indexed.

This feature may seem unnecessary for some in the face of graphical options like the Spotlight system preferences, but in addition to quickly excluding files on the fly, it also has benefits for those who use the Terminal either locally or remotely, where you do not have access to the system preferences.

The one problem with this tip is that altering file extensions may break the system's ability to recognize and use them, so it may not always be practical for use with files; however, when used with folders it may offer a quicker way to prevent spotlight indexing for any enclosed items.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.

About the author

    Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.

     

    Join the discussion

    Conversation powered by Livefyre

    Don't Miss
    Hot Products
    Trending on CNET

    HOT ON CNET

    Mac running slow?

    Boost your computer with these five useful tips that will clean up the clutter.