TekRevue

  • Home
  • OS X
  • Windows
  • Mobile
  • Games
  • Home Theater
  • Reviews
  • Editorials
  • Tips
    • Windows
    • Mac
    • Mobile
  • Twitter
  • Facebook
  • Google+
  • Feed

 000

OS X / Tips

Three Ways to Prevent Spotlight from Indexing Items on Your Mac

By Jim Tanous on July 24, 2013 at 11:51 AM • @mggjim

Spotlight, introduced by Apple with OS X 10.4 Tiger, is a powerful system tool that allows for fast and easy searches of your entire Mac and any attached drives. For single users on secure Macs, it’s one of the best ways to find your files, app data, and even to launch applications. But if you share your Mac with others, or frequently use it in a public place, you may wish to temper Spotlight’s reach. Here are three ways to prevent Spotlight from indexing items on your Mac.

Check out these awesome custom engraved Corkcircle Canteens from Perfect Etch.

Turn It Off

First, and most bluntly, you can turn Spotlight off entirely. Note that this will also affect your ability to search within most of Apple’s applications, such as Mail and Finder, as they rely on the same Spotlight foundation that we’re about to kill.

Open up Terminal from /Applications/Utilities and enter the following command to kill Spotlight entirely (you’ll need administrative privileges to execute the command):

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

You’ll immediately notice that Spotlight is suddenly impotent, and returns only the generic “Search the Web” and “Search Wikipedia” options for each inquiry. In the screenshot below, you can see the result of a search with the default settings (left), and after entering the above command (right).

How to Manage Spotlight Mac OS X

So your files are safe from unauthorized searches but, as we mentioned above, you’re also no longer able to search for emails in Mail, or files from within Finder. If you find that this step was a bit too much, enter the following command to restore Spotlight’s functionality.

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Note that after reenabling Spotlight, it will need to reindex your drive(s), a process that may take a while depending on the size of the drives and the number of changes that occurred since you disabled Spotlight. You can measure the progress of the rebuild by clicking on the Spotlight icon in the menu bar.

Prevent Spotlight from Indexing Items on Your Mac Rebuild

Exclude Items Using Spotlight’s Preferences

Instead of turning the whole thing off, you can simply exclude certain drives or folders from Spotlight by using its Preferences. Head to System Preferences > Spotlight > Privacy. Here you can choose which drives or folders to exclude from Spotlight’s index (note that yours may be empty if you only have a single drive in your Mac).

Prevent Spotlight from Indexing Items on Your Mac Privacy Preferences

Adding a file or folder to this list will exclude it and its contents from Spotlight, meaning that they won’t appear during a Spotlight or Finder search. To add items, you can either click the plus icon and navigate to the drive or folder you want to exclude, or you can simply drag and drop drives and folders into the list.

Prevent Spotlight from Indexing Items on Your Mac Privacy Preferences

To remove items from the list, and thus make them searchable by Spotlight once again, select the item and press the minus icon at the bottom-left side of the list.

This is an easy way to manage Spotlight’s reach, but it includes one critical flaw: anyone with access to your user account can simply head to Spotlight’s Preferences and see exactly what you’ve chosen to hide. It’s like a treasure map to your private files and secrets. Thankfully, there’s still one final option.

Manually Hide Folders Using a Special Extension

The previous methods to prevent Spotlight from indexing items on your Mac covered both folders and drives, but this trick only works with folders and files. To prevent a specific folder or file from being indexed by Spotlight, add a “.noindex” extension to it.

As an example, we have a folder on our Desktop called “Private Documents” containing a file called “Q3 Financial Results.rtf.” By default, searching for this folder or any file within returns a result with Spotlight.

Prevent Spotlight from Indexing Items on Your Mac noindex extension

Now we’ll add “.noindex” to the end of the Private Documents folder (“Private Documents.noindex”). The folder and its contents are immediately excluded from Spotlight and any searches fail to return results from the folder.

Prevent Spotlight from Indexing Items on Your Mac noindex extension

The benefit of this approach is that these manually excluded items do not appear in the Privacy tab of Spotlight’s Preferences, meaning that those snooping around won’t be able to easily locate your private or sensitive data. In our example, the “hidden” folder was on our desktop, which would still be easy to find by just looking at it. In practice, of course, you’ll want to stick your “.noindex” folders somewhere out of plain sight.

As we mentioned above, this technique works with both folders and files, but we recommend putting your sensitive files into folders and then applying the “.noindex” extension only to that top level folder. This not only saves time (you don’t have to manually change the extensions of multiple files), it also prevents issues with standard application file extensions.

Most users will best served by using a combination of methods 2 and 3: excluding cloned backups via Spotlight Preferences and hiding a select few personal documents with “.noindex,” for example. Regardless, Spotlight is a very powerful tool and it’s good to know that users have the ability to reign it in when necessary.

 000

  • Categories: OS X / Tips
  • Tags: #OS X #Search #Spotlight #Tips

Sign Up for the TekRevue Weekly Digest

Read more in OS X or Tips on TekRevue

  • photos app
    How to Hide Pictures in the Photos App on the Mac

    Filed Under: OS X

  • mac web browsers
    How to Change Your Homepage on the Mac (And Why You Might Need To)

    Filed Under: OS X

  • siri mac sierra
    15 Cool Ways to Use Siri in macOS Sierra

    Filed Under: OS X

  • megadroid

    4th way: create a new file called .metadata_never_index at the root of any drive. My favorite way whenever I get a new drive. It also survives unmounts (sometimes, drives added to the Spotlight Privacy pane, are lost when they’re unmounted).

    • Vince

      How do you undo this afterwards? I did it, then decided only to index a few dirs, so I copied it in some folders and removed it from the root. But now it won’t index anything anymore…

      • megadroid

        To force re-indexing, add your drive to Spotlight’s Privacy tab and remove it or enter in Terminal

        sudo mdutil -E /Volumes/[VolumeName]

        where [VolumeName] is your actual drive’s name.

  • Tom Martin

    If you completely disable spotlight, the app store will no longer be aware of when apps need to be updated as that is how that mechanism works. It took me awhile to figure that one out.

    • Smile it is almost Friday!

      So what is the best way to manually update apps? I refuse to re-enable spotlight.

Search

Related Articles

  • ipad safari split view
    View Two Websites Side-By-Side With Safari Split View in iOS 10
  • iphone remove apple apps
    How to Remove Built-In Apple Apps in iOS 10
  • siri mac sierra
    15 Cool Ways to Use Siri in macOS Sierra

Connect with TekRevue

  • TekRevue on Twitter
  • TekRevue on Facebook
  • TekRevue on Google+
  • Cheats
  • Deals
  • Distractions
  • Editorials
  • Gadgets
  • Games
  • Giveaway
  • Hardware
  • Home Theater
  • Mobile
  • News
  • More in OS X
  • Podcast
  • Reviews
  • Sponsor
  • Tips
  • Windows
  • photos app
    How to Hide Pictures in the Photos App on the Mac
  • mac web browsers
    How to Change Your Homepage on the Mac (And Why You Might Need To)
  • siri mac sierra
    15 Cool Ways to Use Siri in macOS Sierra
  • mac app store updates
    How to Make the Mac App Store Check for Updates More Frequently
  • mac contacts app
    Organize and Manage Your Mac Contacts with Smart Groups
  • mac screenshot clipboard
    Quick Tip: Copy Mac Screenshots Directly to the Clipboard
  • change default browser safari
    How to Change the Default Web Browser on Your Mac
  • print maps mac
    How to Print Directions From Your Mac Using the Apple Maps App
  • email macbook
    Three Tips for Creating Professional Emails on the Mac
  • quicktime x autoplay
    How to Enable QuickTime X Autoplay
  • mac contacts app
    How to Remove Duplicate Contacts on Your Mac
  • quicktime x
    How to Edit Video on Your Mac with Quicktime
  • storage disk almost full mac
    5 Tips to Free Disk Space on Your Mac
  • mac printer problem
    4 Tips for Fixing Mac Printer Problems
  • finder file path directories
    How to Open Files with Different Programs on the Mac
  • macos sierra installer
    How to Create a macOS Sierra USB Installer for the Developer Preview
  • macos sierra system requirements
    macOS Sierra System Requirements
  • quicktime x
    How to Loop a Video in QuickTime X for Mac OS X
  • photos macbook
    How to Delete All of Your iPhone or iPad Pictures at Once
  • Mail Icon Aqua Background
    How to Fix Incorrect Email Address Suggestions in Mail for Mac OS X

Explore More Topics

Amazon Android Apple Apps Benchmarks Beta Software Consoles Deals Displays Editorial Games Gaming Google How To iOS iOS 7 iOS 8 iPad iPhone iPod touch iTunes Mac Microsoft Operating Systems OS X OS X Mavericks OS X Yosemite Podcast Review Safari Samsung Security Smartphones Software Updates Sponsor Tablets Tips UI Customization Web Browser Windows Windows 7 Windows 8 Windows 8.1 Windows 10 Xbox One

Tips

  • Apps
  • Gaming
  • Mac
  • Mobile
  • Online
  • Windows
  • gotomeeting mac
    Quick Tip: Remove Old Versions of GoToMeeting for Mac
  • spell check word
    How to Turn Off Real-Time Spell Check in Microsoft Word
  • format skype text chats
    How to Format Skype Text Chats
  • chrome for mac os x
    How to Test Chrome’s Native Notifications for Mac
  • classic solitaire windows xp
    How to Play Classic Windows XP Solitaire in Windows 10
  • ipad controller game
    How to Set Up and Game With an iOS Controller on Your iPhone or iPad
  • ps4 remote play mac
    How to Change PS4 Remote Play Resolution & Frame Rate on the Mac
  • steam trash
    How to Remove a Game From Your Steam Library
  • photos app
    How to Hide Pictures in the Photos App on the Mac
  • mac web browsers
    How to Change Your Homepage on the Mac (And Why You Might Need To)
  • siri mac sierra
    15 Cool Ways to Use Siri in macOS Sierra
  • mac app store updates
    How to Make the Mac App Store Check for Updates More Frequently
  • ipad safari split view
    View Two Websites Side-By-Side With Safari Split View in iOS 10
  • iphone remove apple apps
    How to Remove Built-In Apple Apps in iOS 10
  • iphone app refresh
    Save iPhone Battery Life by Disabling Background App Refresh
  • iphone mail unread badge
    How to Manage iPhone Email Notifications and Hide the Unread Mail Badge
  • youtube loop
    How to Loop YouTube Videos
  • netflix bandwidth data usage
    How to Reduce Netflix Bandwidth Usage to Avoid ISP Data Caps
  • netflix autoplay
    How to Stop Netflix From Automatically Playing the Next Episode
  • distracted man computer
    How to Turn Off Distraction-Free Mode in WordPress
  • speakers
    Quickly Change the Audio Playback Device in Windows 10 Anniversary Update
  • windows 10 snipping tool
    How to Take Windows 10 Screenshots with the Snipping Tool
  • windows 10 action center icon taskbar
    How to Hide the Action Center Taskbar Icon in the Windows 10 Anniversary Update
  • create pdf windows
    How to Create a PDF from Multiple Images in Windows 10
Company
  • About TekRevue
  • Get in Touch
  • Sponsorships

Sign Up for the TekRevue Weekly Digest

© TekRevue LLC. All Rights Reserved.

  • TekRevue User Agreement
  • TekRevue Privacy Policy

Built by Blazer Six