If you never use the Spotlight feature on your Mac, or if you only use it from the Finder rather than from the menu bar, you may have wondered how to get rid of its icon. Whilst most of the menu bar icons can be hidden with user-accessible toggles from System Preferences, Spotlight’s little magnifying glass is not so easily removed from the top right-hand corner of your screen.

After a lot of investigation I had only found methods which either disabled Spotlight entirely, removing your ability to search the file system, or else hid Spotlight temporarily, with it returning every time a change was made to the file system. However, I was eventually able to find a solution which has neither of these downsides.

In this guide, we’ll show you how to get rid of the Spotlight icon, and regain an iron-fisted control over the content of your menu bar.

Instructions

Please bear in mind that modifications to system files can cause problems if carried out incorrectly. Enter the following commands carefully, and proceed at your own risk.

This command patches Spotlight to make the icon width zero. This effectively makes the item invisible on your menu bar, without disabling Spotlight itself.

8) Enter the following command into Terminal, and press Enter:

cmp -l Spotlight Spotlight.bak

You should see Terminal print out something similar to this:

248855 0 102 248856 0 100

We are comparing the two files here. If the command does not print out anything at all, then the process has not worked and you should follow our process below for reverting the changes we have made.

9) Now enter this into Terminal:

sudo codesign -f -s - Spotlight

This signs our new Spotlight ready for use. If you receive an error here related to missing Command Line Tools and xcrun, install Xcode or run “xcode-select –install” in Terminal, both of which will provide the missing tools for the job.

10) And finally, this:

sudo killall Spotlight

This restarts the Spotlight daemon to make our changes effective.

Your entire Terminal session should look something like mine below:

Spotlight might ask for access to your keychain again, select Always Allow. It may also ask for some other privileges such as Calendars and Contacts access. Grant or deny those as you see fit. Check the top-right corner of your screen to confirm that the icon is gone. If it’s not, try a reboot.

11) Once you’ve confirmed that it works, re-enable SIP.

That should do it. Spotlight search will still function from the Finder and when summoned with a keyboard shortcut, but will no longer trespass upon your menu bar.

Reverting your changes

If you’re already missing the convenience and charm of Spotlight in your menu bar, we can easily reverse our changes to resuscitate the little fellow.