
Quick Answer
To stop Spotlight from indexing a specific folder:
- Open System Settings.
- Select Spotlight in the sidebar.
- Click Spotlight Privacy.
- Drag the folder into the list, or click the + button and choose it.
- Close the settings window.
Spotlight will stop searching that folder and its contents. To allow Spotlight to index it again, return to Spotlight Privacy, select the folder, and click the – button.
Why Exclude a Folder from Spotlight?
Spotlight creates an index of files and their contents so you can find them quickly from the menu bar or with the Command-Space keyboard shortcut. Most users benefit from this, but you may want to exclude a folder if it contains:
- Private documents or sensitive work files
- Large archives, backups, or virtual machines
- Temporary files that produce unwanted search results
- Developer project files that make searches less useful
- Files stored on an external drive
- Data that you do not want appearing in Spotlight results
Adding a folder to Spotlight’s privacy list prevents Spotlight from indexing it. This does not encrypt, hide, or delete the folder. Anyone who can open the folder in Finder can still access its contents.
Method 1: Exclude a Folder in System Settings
The simplest method is to add the folder to Spotlight’s privacy list.
1. Open System Settings
Select the Apple menu in the upper-left corner of the screen, then choose System Settings.
2. Open Spotlight settings
In the System Settings sidebar, select Spotlight. You may need to scroll down to find it.
3. Open Spotlight Privacy
Scroll to the bottom of the Spotlight settings page and click Spotlight Privacy.
A window or panel will show locations that Spotlight is prevented from searching.
4. Add the folder
You can add the folder in either of two ways:
- Drag the folder from Finder into the Spotlight Privacy list.
- Click the + button, browse to the folder, select it, and click Choose.
If you use the + button, open the location containing the folder, select the folder itself, and then confirm your choice. You do not need to open the folder before selecting it.
5. Confirm the folder is listed
The folder should now appear in the Spotlight Privacy list. You can close System Settings when finished.
Spotlight may take a short time to stop displaying results from the excluded location. Existing results can remain visible briefly while macOS updates its index.
Important: Adding a folder to Spotlight Privacy does not remove any files. It only prevents Spotlight from indexing and returning results from that location.
How to Exclude a Folder with Finder
You can also add a folder by dragging it from Finder.
- Open System Settings.
- Select Spotlight.
- Click Spotlight Privacy.
- Open a Finder window with the folder you want to exclude.
- Drag the folder into the Spotlight Privacy list.
- Close both windows when finished.
This is often faster when the folder is already visible in Finder. Drag the folder itself, not an individual file inside it, if you want to exclude everything it contains.
How to Remove a Folder from the Privacy List
If you change your mind, you can allow Spotlight to index the folder again.
- Open System Settings.
- Select Spotlight.
- Click Spotlight Privacy.
- Select the folder in the list.
- Click the – button.
- Close System Settings.
After you remove the folder, Spotlight can index it again. The process may not be immediate, especially if the folder contains many files. Search results may gradually reappear as indexing resumes.
What Happens After You Exclude a Folder?
Excluding a folder affects Spotlight searches, but it does not change the folder itself.
The files remain in place
macOS does not move, delete, rename, or modify the files when you add their folder to Spotlight Privacy.
Finder can still open the folder
You can browse the folder normally in Finder. Applications can also open and save files there.
Spotlight stops returning its contents
Files inside the excluded folder should not appear in Spotlight results. Their names and contents are removed from normal Spotlight searches after the privacy setting takes effect.
Other search tools may still find the files
This setting is not a security feature. Applications with their own search indexes may still find the files. A person who knows where the folder is can also open it directly.
Subfolders are generally covered
When you exclude a folder, the contents beneath it are also excluded. If you later move files outside that folder, those files may become searchable again unless their new location is also excluded.
Exclude an External Drive or Volume
Spotlight Privacy can also exclude an entire external drive or another connected volume.
- Connect the drive to your Mac.
- Open System Settings.
- Select Spotlight.
- Click Spotlight Privacy.
- Drag the drive from Finder into the list, or click + and select it.
- Confirm that the drive appears in the list.
This prevents Spotlight from indexing the entire volume. If you only want to exclude one folder on the drive, select that folder instead of the drive.
Some external drives may not remain connected long enough for you to add them. In that case, connect the drive first and then open Spotlight Privacy. The drive may also use a format or connection method that limits how macOS handles indexing.
Use Terminal to Exclude a Folder
Terminal provides another way to add or remove a location from Spotlight’s privacy settings. This can be useful if System Settings does not accept a folder or if you are comfortable working with commands.
Warning: Terminal commands change Spotlight’s indexing behavior. Carefully replace the example path with the correct folder path. Do not run commands you do not understand, and avoid changing paths that contain important system data.
Add a folder to Spotlight Privacy
Open Terminal from the Applications folder or by searching for it with Spotlight. Then run:
mdutil -i off "/path/to/folder"
Replace /path/to/folder with the actual path to the folder.
For example:
mdutil -i off "$HOME/Documents/Archive"
This tells the Spotlight metadata service to stop indexing the specified location. The "$HOME" portion represents your home folder, and the quotation marks help protect paths containing spaces.
You can also drag a folder from Finder into the Terminal window after typing the command and a space. Finder will insert the folder’s full path automatically.
Remove the folder from indexing with Terminal
To turn indexing off for a folder, use:
mdutil -i off "/path/to/folder"
The command changes indexing for that location. It does not delete files or disable Spotlight across your entire Mac.
Re-enable indexing
To reverse the change, run:
mdutil -i on "/path/to/folder"
This allows Spotlight to index the folder again. Depending on the folder’s size, it may take time for its contents to appear in search results.
Check the indexing setting
To view the current indexing status for a location, run:
mdutil -s "/path/to/folder"
The output indicates whether indexing is enabled for that path.
The System Settings method is usually easier because it gives you a visible list of excluded locations. Use Terminal when you need command-line control or are troubleshooting a settings problem.
If the Folder Still Appears in Spotlight
It can take a little time for Spotlight to update after you exclude a folder. Try these steps in order.
Confirm the correct folder was added
Return to System Settings > Spotlight > Spotlight Privacy and check the list. Make sure you added the parent folder that contains the files you want to exclude.
For example, excluding one project folder does not exclude a similarly named folder elsewhere on your Mac.
Check whether the result is from another location
Spotlight may show a file with the same name from a different folder. In the search result, open the file’s location or use Finder to verify its path. The result may not come from the excluded folder.
Wait for the privacy change to take effect
Spotlight may continue displaying a previously cached result for a short time. Close the search window, wait briefly, and search again.
Remove and re-add the folder
If the folder is listed but still appears in results:
- Open Spotlight Privacy.
- Select the folder.
- Click the – button.
- Add the same folder again with the + button or by dragging it into the list.
- Test Spotlight again.
This refreshes the privacy entry without changing the files inside the folder.
Restart your Mac
A restart can clear temporary Spotlight or Finder behavior. Save your work first, then choose Restart from the Apple menu.
Check Spotlight’s broader settings
If searches behave unexpectedly across many locations, review the available Spotlight settings in System Settings > Spotlight. You can also check the current indexing state before changing anything. For more detail, see How to Check Spotlight Indexing Status on a Mac.
If Spotlight Does Not Index the Folder After You Re-Enable It
After removing a folder from Spotlight Privacy, indexing may take time to begin. Confirm that:
- The folder is no longer listed in Spotlight Privacy.
- The folder is stored on a connected and accessible volume.
- You have permission to access the folder.
- The drive is mounted and available in Finder.
- The files are in a location supported by Spotlight.
If the folder contains many files, indexing can take longer than expected. You can check indexing activity and status before attempting more advanced repairs.
Does Excluding a Folder Improve Performance?
It may reduce the amount of data Spotlight needs to index, particularly if the folder contains large collections of files that change frequently. However, excluding folders should not be treated as a general performance fix.
The most practical reason to use Spotlight Privacy is to make search results more relevant or prevent a specific location from appearing in Spotlight. Exclude only the folders you genuinely do not want indexed.
Frequently Asked Questions
Does adding a folder to Spotlight Privacy delete its files?
No. The files remain in the same location and can still be opened, edited, copied, and deleted normally. Spotlight Privacy only affects indexing and search results.
Can I exclude just one file instead of an entire folder?
Yes. Spotlight Privacy can accept individual files as well as folders. Add the file instead of its containing folder if you want other files in that folder to remain searchable.
Does this hide the folder from Finder?
No. The folder remains visible in Finder and can be opened by anyone with access to your Mac and the necessary permissions.
Will applications still be able to search the excluded folder?
It depends on the application. Spotlight Privacy controls macOS Spotlight indexing, but some apps maintain separate databases or use their own search systems.
Can I exclude the entire Mac?
You can add broad locations to Spotlight Privacy, but doing so prevents Spotlight from indexing those locations. This may make Spotlight much less useful. Excluding a specific folder is usually the better approach.
Why do excluded files still appear briefly?
Spotlight may need time to update its index and clear previously displayed results. Verify the folder is listed in Spotlight Privacy, then wait and search again.
Can I still use Spotlight to open apps after excluding a folder?
Yes. Excluding a folder does not disable Spotlight entirely. Spotlight can continue searching other indexed locations and opening apps, files, and settings.
Final Thoughts
The quickest way to stop Spotlight from indexing a folder is to add it to System Settings > Spotlight > Spotlight Privacy. This prevents the folder and its contents from appearing in Spotlight searches without moving or deleting anything. To reverse the change, select the folder in the privacy list and click the – button.