Sub topic 9
Choosing what Spotlight shows and excluding folders
This chapter assumes you can open Spotlight with Command-Space, search for files, and use System Settings. You will control which result categories Spotlight displays and which folders it leaves out.
Why change the defaults
Spotlight searches everything it can index. That is often too much. A search for "report" may bring up web suggestions, emails, and old project folders when you only want documents. Two settings fix this: result categories decide what kinds of results appear, and the privacy list decides which locations Spotlight skips.
Choosing result categories
Open System Settings, then choose Spotlight. On recent macOS versions, this pane is under Spotlight in the sidebar. The exact layout varies by version, so look for the list of categories if yours differs.
The pane lists the result types Spotlight can show, such as:
- Applications
- Documents
- Folders
- PDF Documents
- Images
- Messages and Mail
- Contacts
- System Settings
- Websites and other suggestions
Each item has a checkbox. Clear a box and that category no longer appears in Spotlight results.
- Open System Settings and select Spotlight.
- In the category list, clear the checkboxes for results you never use.
- Open Spotlight with Command-Space and repeat a search to confirm the change.
Excluding folders
Some folders produce noise: backups, downloaded archives, code dependencies, or private material. You can tell Spotlight to ignore them.
- In the Spotlight pane, click Search Privacy (labelled Search Privacy… on some versions).
- Click the + button, or drag a folder or disk into the list.
- Choose the folder and confirm.
- Click Done.
Spotlight stops returning anything from that location. To undo it, select the folder in the list and click the − button.
What happens behind the scenes
When you add a folder to the list, Spotlight stops returning results from it and removes its existing entries from the index. When you remove the folder from the list, macOS indexes it again. Large folders can take a while to reappear in results.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| A file you know exists never appears | It is inside an excluded folder, or a parent folder is excluded | Check **Search Privacy** and remove the folder |
| Apps appear but documents do not | The Documents or PDF category is cleared | Re-enable the category |
| Results reappear slowly after removing an exclusion | Spotlight is re-indexing the folder | Wait, then search again |
| Excluding a folder did not hide its files from Finder | Exclusion affects Spotlight only | Use file permissions or encryption for privacy |
A parent folder exclusion covers everything beneath it. If you exclude your whole Documents folder to hide one subfolder, you hide all your documents. Exclude the narrowest folder that solves the problem.
Checking your setup
After you change settings, test with a file you know should appear and one that should not. Search for the first by name. Then search for a distinctive word from a file inside an excluded folder. The first should appear and the second should not.
Exercise
You excluded ~/Projects to hide old code, but now a PDF in ~/Projects/Invoices that you need does not appear in Spotlight. What are two ways to get it back, and which keeps the old code hidden?
Show answer
You can remove ~/Projects from the Search Privacy list, which brings back everything including the old code. Or you can remove ~/Projects and instead exclude only the specific old-code subfolders, which keeps the code hidden while the Invoices folder is searchable again. The second option keeps the code hidden.