Exclude Folders from Spotlight Search on macOS for Privacy
In this article
You can stop Spotlight from indexing specific folders to keep sensitive files private and out of search results. This prevents the system from scanning, cataloging, and displaying the contents of those directories when you use the search function (Command + Space). It is useful for hiding personal documents, financial records, or project folders from appearing in previews or search suggestions on your Mac.
What You'll Need
- A Mac running macOS (these steps apply to macOS Ventura, Sonoma, and later; menu labels may differ slightly on older versions like Monterey).
- Administrator access (you will need to enter your password to confirm changes).
Step-by-Step
- Open System Settings. Click the Apple menu () in the top-left corner of your screen and select System Settings (or System Preferences on older macOS versions).
- Go to Siri & Spotlight. In the System Settings sidebar, scroll down and click on Siri & Spotlight. On older macOS versions, look for the Spotlight preference pane icon.
- Open Spotlight Privacy. Scroll down to the bottom of the Siri & Spotlight settings window until you see a button labeled Spotlight Privacy…. Click this button to open the privacy exclusion list.
- Add a Folder to Exclude. In the Privacy tab, click the + (plus) button located below the list of excluded locations.
- Select the Directory. A file browser window will appear. Navigate to the specific folder or directory you want to hide from Spotlight. Select the folder and click Choose. If you cannot see the folder, press Command + Shift + Period to toggle hidden files visibility in the browser.
- Confirm the Exclusion. The folder will appear in the Privacy list. Spotlight will immediately stop searching this location. If the folder was previously indexed, macOS will delete the existing index for that location, which may take a few moments.
- Close the Window. Click Done or simply close the System Settings window. Your changes are saved automatically.
Common Mistakes
One frequent mistake is adding a parent folder when you only need to hide specific contents. If you exclude your entire "Documents" folder, Spotlight will not find any files in Documents. It is better to create a dedicated private folder inside Documents and exclude only that specific directory.
Another mistake is expecting the files to be encrypted. Excluding a folder from Spotlight does not encrypt it. The files remain visible in Finder and accessible to anyone who uses your Mac. This setting only removes them from the search index.
Users also sometimes forget that Spotlight is not the only way people find files. The files will still show up in Finder windows if someone browses to that location manually. For true privacy from other users, you must use FileVault encryption or a separate user account.
Tips
If you need to hide a folder that is difficult to find in the file browser, you can drag the folder directly from Finder into the Spotlight Privacy list window. This is often faster than navigating through the browse dialog.
For advanced users, you can exclude locations using the Terminal command sudo mdutil -d /path/to/folder, but the System Settings method is safer and easier to reverse.
If you exclude a folder but later decide you want it searchable again, simply select the folder in the Privacy list and click the – (minus) button. Spotlight will re-index the folder, which may take some time depending on the number of files.
Troubleshooting
If files from an excluded folder still appear in Spotlight search results, try restarting your Mac. The indexing service (mds) may need a restart to clear the cache fully.
If you cannot add a folder because it is locked or you do not have permission, check the folder permissions in Finder. Right-click the folder, select Get Info, and look at the Sharing & Permissions section at the bottom. Ensure your user account has Read & Write access.
If the Privacy list is empty but Spotlight is not finding anything, the main Spotlight index might be corrupted. You can rebuild the entire index from the same Privacy tab: add your main hard drive to the list, then remove it immediately. This forces macOS to delete and rebuild the entire index, which can take hours.
Frequently Asked Questions
Does excluding a folder delete the files inside it?
No. Excluding a folder from Spotlight only removes the files from the search index. The files remain safely on your hard drive and can be opened normally through Finder or the application that created them.
Will this hide files from other user accounts?
No. Excluding a folder does not change file permissions. If another user has access to your home folder or the specific directory, they can still see and open the files. To protect data from other users, create a separate standard user account for them or use FileVault.
Can I exclude external drives?
Yes. You can add external hard drives, USB sticks, or network volumes to the Spotlight Privacy list. Spotlight will not index their contents while they are connected.
Why does Spotlight still find files I excluded?
The search results may be cached. Wait a few minutes after adding the exclusion, or restart your Mac. If the problem persists, ensure you excluded the correct folder and not an alias or shortcut.
Is there a limit to how many folders I can exclude?
There is no practical limit to the number of folders you can add to the Privacy list. However, excluding too many locations may slow down your ability to find files, so only exclude directories that genuinely need to be private.
Does this affect Time Machine backups?
No. Excluding a folder from Spotlight search does not exclude it from Time Machine backups. The files will still be backed up unless you specifically configure Time Machine to ignore that folder.