macOS WiFi – How to Hide or Remove Network Names from the WiFi Menu Bar

macossoftware-recommendationwifi

I have obnoxious neighbors that think its funny to use offensive words for their SSIDs.

I would like to remove those SSIDs from, at a minimum, the wifi menubar icon. If its easier, hiding/removing them from the OS completely (menubar icon and system prefs) would be acceptable.

I'm an OS X newbie, so I don't even know where to start with this.

I prefer built-in solutions (read: free), but solutions < $10.00 would be ok too.

Best Answer

You could place something like this Applescript in you Applescript Menu and use it to list you preferred networks, choose on and connect to it.

set the getList to paragraphs of (do shell script "networksetup -listpreferredwirelessnetworks en0")


    set title to item 1 of getList
    set wifi_list to items 2 thru -1 of getList

   set the chosen_newtwork to choose from list the wifi_list with prompt "Choose a " & title without multiple selections allowed

    if the chosen_newtwork is false then return

    do shell script "networksetup -setairportnetwork en0  " & (chosen_newtwork as string)

enter image description here

(I cannot say this is perfect as I have found it sometimes does not always want to connect but I am unsure if that is just my router/wifi)


Update.

Using the same idea above, you could also create a banned list of bad ssids.

And filter them.

The main command is using a airport framework command instead of the networksevice command so is a tad slower. But scans for available networks instead of just you preferred.

    set bannedList to {"BTWifi-X"}
    set wifi_list to {}
    set the getList to paragraphs of (do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s |awk '{print  $1}'")

    set title to item 1 of getList
repeat with i from 2 to number of items in getList
        set this_item to item i of getList
        if this_item is not in bannedList then
            if this_item is not in wifi_list then -- stops duplicates from original list
                copy this_item to end of wifi_list
            end if
        end if
    end repeat

    set the chosen_newtwork to choose from list the wifi_list with prompt "Choose a " & title without multiple selections allowed

    if the chosen_newtwork is false then return

    do shell script "networksetup -setairportnetwork en0  " & (chosen_newtwork as string)