How to stop Spotlight hogging disk space on macOS

Jump to First Reply
Posted:
in macOS

Spotlight in macOS stores some of its indices and search data on your Startup Disk. Here's how to minimize Spotlight using disk space.

Reduce the disk space Spotlight uses in macOS.
Here's how to reduce Spotlight's disk space use in macOS Sequoia.



Spotlight is Apple's file indexing technology, which stores a database of the files on your Mac and their contents. When you type something into the Spotlight search bar by clicking on its icon in the menu bar in macOS, this index provides a fast and efficient lookup of what you're searching for.

Over time, the indices Spotlight keeps on your Mac can grow to huge sizes - several hundred megabytes or more.

For various reasons, you may want to recover this disk space and refresh the Spotlight indices from time to time. There are several ways to accomplish this.

Use System Settings



In the macOS System Settings app, there's a Spotlight item in the sidebar on the left. Clicking this item loads a list of checkboxes that allow you to set which file types you want Spotlight to index.

Turn off any file types or settings you don't want Spotlight to use. This will reduce the size of the Spotlight data overall.

Reducing the number of items Spotlight indexes saves disk space.
Use System Settings in macOS to control which items Spotlight indexes.



If you click the Search Privacy... button at the bottom of the Spotlight pane, you'll get a sheet that allows you to exclude entire disk volumes or folders from being indexed. Keep in mind the volumes listed in this sheet are an exclusion list, not an inclusion list. Drag disk volumes or folders from the Finder to the sheet to exclude them from Spotlight indexing.

Remove the Spotlight index files in the Finder



The Spotlight index files and settings live on your Startup Disk at /Users/~/Library/Metadata/CoreSpotlight. In particular, the sub-folders "Priority" and "NSFileProtectionCompleteUntilFirstUserAuthentication" that contain the indexed data can become large.

Most of the other files/folders in the "CoreSpotlight' folder are small and can be left alone or deleted.

When you move these files/folders to the Trash and Finder->Empty Trash, you delete the Spotlight indices from your Mac - and potentially save several hundred megabytes of disk space. Keep in mind, once you delete these files/folders, you will lose all stored Spotlight saved data until macOS rebuilds the indices.

Once you remove the files, you may want to restart your Mac.

Spotlight stores its files in the user's Metadata folder in a folder named
The CoreSpotlight folder in the user's Library folder.

Disable Spotlight indexing in the Terminal



If you're comfortable using macOS's Terminal app, you can turn off Spotlight indexing completely by using the command-line tool mdutil. To do so, open the Terminal app and type:

sudo mdutil -i off and press Return on your keyboard. Enter an admin password if prompted. This turns off Spotlight indexing.

To get a full list of mdutil commands and options in Terminal, type:

man mdutil and press Return. Exit the man system by pressing Control-Z or the q key on your keyboard.

Just be aware that when you turn off indexing, you might not get accurate results from then on if you type something into the Spotlight search bar.

Rebuild Spotlight indices



Apple has a page Rebuild the Spotlight index on your Mac which details how to force macOS to rebuild the Spotlight indices on your Mac.

To do so, first follow the steps described in another Apple technote If searching your Mac returns unexpected results.

Once this is done, follow the steps mentioned above in the System Settings app using the privacy sheet to re-add volumes and folders you want Spotlight to search.

Also see the page Spotlight settings on Mac.

Keeping your Spotlight data in order can save you disk space, and it doesn't take too much effort, so you should consider periodic maintenance to keep Spotlight running as efficiently as possible.



Read on AppleInsider

Comments

  • Reply 1 of 2
    Penzipenzi Posts: 37member
    Is there a reason one would want to turn off the indexing? Saving space seems low hanging fruit elsewhere. Remove a single unused app, for example…
    muthuk_vanalingamforgot username
     2Likes 0Dislikes 0Informatives
  • Reply 2 of 2
    swat671swat671 Posts: 162member
    Saving a few hundred megabytes on a drive that’s probably a few hundred gigs, or a few terabytes? Meh. 
    appleinsideruserforgot username
     2Likes 0Dislikes 0Informatives
Sign In or Register to comment.