How to hide Spotlight in menu bar but keep the ⌘Space keyboard shortcut? I want to hide spotlight from the menu bar



I never click this button.



So I followed the instructions here and used this code to change the Spotlight file in some way:

sudo perl -pi -e 's|(\x00\x00\x00\x00\x00\x00\x47\x40\x00\x00\x00\x00\x00\x00)\x42\x40(\x00\x00\x80\x3f\x00\x00\x70\x42)|$1\x00\x00$2|sg' Spotlight


It hid the menu-bar icon, but it also disabled the ⌘+space keyboard shortcut that I use a lot.

Is there a way to hide the icon in the menubar but allowing the keyboard shortcut to work?



I just saw this other question asking the same thing but for Yosemite.

The accepted answer doesn't work for me on High Sierra, and all the other answers suggest using third-party tools like Bartender which I don't want to do.
The easiest way I know to do this is with a third party app like Bartender (https://www.macbartender.com). The app is used to hide pretty much any menu bar icon, and has a lot of great features. It's kind of a "must have" for and Mac Power User.