How to Completely Disable ‘Spotlight Indexing’ System-Wide on a Mac

Spotlight is the central search mechanism in macOS, allowing users to rapidly find documents, launch applications, and search the web simply by pressing Command + Space. To facilitate these lightning-fast searches, the background process (mds and mdworker) constantly scans and indexes every file, metadata tag, and text string across your entire hard drive. While highly efficient for most users, Spotlight indexing can severely degrade system performance when dealing with massive code repositories, active video rendering directories, or external drives filled with millions of tiny files.

This guide explains how to completely disable Spotlight indexing system-wide on a Mac, killing the mds background processes and forcing macOS to rely on manual file path navigation.

Disable Spotlight Indexing via Terminal

Apple does not provide a simple toggle switch in System Settings to completely disable the Spotlight daemon. Instead, you must use the mdutil (metadata utility) command within the Terminal to forcefully halt the indexing engine across all mounted volumes.

  1. Open the Terminal application (located in Applications > Utilities).
  2. To completely disable indexing on your primary Mac hard drive (the root volume), execute the following command:
    sudo mdutil -i off /
  3. You will be prompted to enter your macOS administrator password. The password will not display on the screen as you type it. Press Enter when finished.
  4. The Terminal should return a confirmation message stating: /: Indexing disabled.

This command immediately stops the mdworker processes from scanning new files on your internal drive. However, if you plug in an external USB drive, macOS may attempt to index it. To disable Spotlight indexing across all currently mounted volumes simultaneously, use the -a flag:

sudo mdutil -a -i off

Purge the Existing Spotlight Index Data

Disabling the indexer stops future scanning, but the massive database file (which can often consume several gigabytes of disk space) remains on your hard drive. If your goal is to reclaim storage space, you must explicitly erase the existing index.

  1. In the Terminal, execute the following command to erase the hidden index directory on the root volume:
    sudo mdutil -E /
  2. To erase the index data across all currently connected drives, use:
    sudo mdutil -a -E

Once disabled and erased, pressing Command + Space will still bring up the Spotlight search bar, but it will only be capable of performing basic dictionary lookups and web searches; it will no longer return local files or documents.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.