everyday mac tools

Keep private files out of Spotlight search on a Mac

· 6 min read

To hide files from Spotlight on a Mac, put them in one folder and add that folder to Spotlight’s privacy list: System Settings, Spotlight, Search Privacy, then the plus button. Spotlight removes the folder from its index, so its files stop appearing in the Spotlight window, in Finder searches and in Finder’s Recents. It does not hide, lock or encrypt anything: anyone using your Mac can still open the folder in Finder.

So the privacy list stops a passport scan popping up in a search. It does not stop someone at your Mac reading it. This guide covers both.

Why Spotlight turns up private files

Spotlight indexes what is inside files, not only their names. Search for your bank’s name and it can find a statement saved as scan0042.pdf, because the bank’s name is in the text of the PDF. Highlight the result and the preview panel on the right of the Spotlight window shows the page. Renaming a file does not keep it out of search.

The same index feeds far more than the Spotlight window:

  • the search field in every Finder window,
  • the Recents item in the Finder sidebar, which is a saved Spotlight search,
  • the search field in Open and Save dialogs,
  • mdfind in Terminal,
  • search inside apps that rely on Spotlight rather than their own index.

That is the useful part of the privacy list: one setting takes a folder out of all of them at once.

Hide files from Spotlight on a Mac with Search Privacy

On macOS 15 Sequoia:

  1. Gather the private files into one folder, for example Documents/Private. An excluded folder covers everything inside it, subfolders included.
  2. Open System Settings and click Spotlight in the sidebar.
  3. Scroll to the bottom and click Search Privacy.
  4. Click the plus button (its tooltip reads “Add a folder or disk to exclude”), choose the folder and click Choose. Dragging the folder from Finder into the list works too.
  5. macOS warns that “the search feature won’t work in some applications”. Confirm, then click Done.

On macOS 13 Ventura and 14 Sonoma, the pane is called Siri & Spotlight and the button reads Spotlight Privacy. On macOS 12 Monterey and earlier, open System Preferences, Spotlight, and use the Privacy tab. If you are on a newer version and the wording has moved again, look for the privacy button at the foot of the Spotlight settings.

The list takes folders and whole disks, not single files and not patterns. Adding an external drive keeps everything on it out of search, which suits a drive of archives you never need to find. A Time Machine backup disk is the exception: macOS says it will keep searching the backups and ignore only the other items on the disk.

Check that it worked

Search Spotlight for a word you know is inside one of the files. It should no longer come up. For a precise answer, run this in Terminal with your folder’s path:

mdfind -onlyin ~/Documents/Private -count 'kMDItemDisplayName == "*"'

Before the exclusion it prints the number of indexed items in the folder. Afterwards it should print 0. On a large folder, give Spotlight a minute to drop the entries.

What the privacy list does not do

Excluding a folder takes it out of search and changes nothing else.

  • The folder still opens. Anyone at your Mac can browse to it in Finder, where its files show thumbnails and open in Quick Look as usual.
  • The list is readable. Anyone who opens Search Privacy sees the path of every folder you excluded. A folder named Private on that list is a signpost.
  • Copies elsewhere are still indexed. The original download in Downloads, the attachment in Mail, the copy you dragged to the Desktop: each is a separate file and each still turns up. Find and deal with them first.
  • Apps remember names. Open Recent menus and the Apple menu’s Recent Items are separate from Spotlight. Clear recent files on a Mac covers each list.
  • Backups carry on. Time Machine has its own exclusion list, so the folder is still backed up as normal.
  • Mounted disk images are separate disks. An encrypted disk image, once opened, shows up as a disk of its own, and Spotlight can index it while it is mounted, so its contents can appear in searches until you eject it.

If what bothers you is clutter rather than privacy, such as thousands of dependency or cache files burying the results you want, that is a different job with better tools. How to exclude a folder from a file search on a Mac covers filtering a single search without touching the privacy list.

Other controls: .noindex, categories and Siri Suggestions

A folder name ending in .noindex. Spotlight skips any folder whose name ends in .noindex, which is how Xcode keeps its build folders out of the index. On the Mac this guide was written on, an Index.noindex folder holding 2,014 files had none of them in Spotlight, while the Products folder next to it was indexed normally. The extension shows in Finder, so it is no more discreet than the privacy list. Its one advantage is that it travels with the folder to an external drive or another Mac. After renaming, check with the mdfind count above.

Result categories. The Spotlight pane lists categories such as Documents, Folders and PDF Documents, with the note “Only selected categories will appear in Spotlight search results.” Unticking one hides every file of that kind from the Spotlight window, private or not, but the files stay in the index and Finder’s search still finds them. It is tidying, not privacy.

Siri Suggestions. This is one of those categories; untick it if you want Spotlight to show only what matches your typing. The Siri pane (Apple Intelligence & Siri on Macs that support it) also lists your apps, each with a “Learn from this application” switch that stops Siri building suggestions from how you use it.

When you need a lock, not a hiding place

Every method above makes files harder to stumble on. None stops a person at your logged-in Mac who opens the folder. If that person is the worry, the contents need a password.

The built-in option is an encrypted disk image made with Disk Utility. Encrypt a folder on a Mac with Disk Utility walks through it, including the step people forget: deleting the unencrypted original afterwards.

Hushbox does the same kind of encryption in place: right-click a file or folder in Finder and choose Lock with Hushbox. While an item is locked, what is inside stays out of Spotlight, Finder Recents and Quick Look previews and thumbnails, and when you unlock it the contents open in a private encrypted space that Spotlight never indexes, so there is no privacy list to maintain and no folder path advertised in System Settings. It hides contents, not names: the locked item’s name still shows in its folder, so call it something dull. Copies made before you locked it, such as that Downloads original or an old Time Machine backup, are not changed. It also does not replace FileVault, which is what protects the disk if the Mac itself is lost or stolen.

Questions

Does excluding a folder from Spotlight hide it in Finder? No. The folder and its files look and open exactly as before. Only searches that go through Spotlight stop finding them.

Will excluded files still show up in Finder’s Recents? No. Recents is a Spotlight search, so anything in an excluded folder drops out of it along with every other Spotlight result.

Can I hide a single file from Spotlight? Not through the privacy list, which takes folders and disks only. Put the file in a folder of its own and exclude that folder.

Does the privacy list stay in place? Yes, through restarts, until you remove an entry with the minus button. After a major macOS upgrade it is worth opening the list once to confirm your folders are still there. Removing an entry makes Spotlight index that folder again from the start.