networksetup -removepreferredwirelessnetwork en0 "Network Name"Remove a saved network from the Wi-Fi list (needs admin rights).
When to use it
Forget a network when your Mac keeps joining a weak or unwanted one, when its password changed and joining fails, or to clear stale settings before troubleshooting.
Steps
Open Wi-Fi settings
System Settings › Wi-Fi. Saved networks are under Known Networks (or behind Advanced…).Forget it
Click ⋯ next to the network and choose Forget This Network…, then confirm.Or just stop auto-joining
In the same ⋯ menu, untick Auto-Join to keep the password but stop automatic connection.Terminal
Useful for scripts; the name must match exactly.networksetup -removepreferredwirelessnetwork en0 "Café Guest"
Output explained
networksetup -listpreferredwirelessnetworks en0 lists saved networks before and after:
Preferred networks on en0:
Home
Café Guest
Removing a network deletes it from this list; the password stays in Keychain until you remove it there, but it's no longer used.
Options and variations
| Flag | Meaning | Example |
|---|---|---|
| -listpreferredwirelessnetworks IF | List saved networks | networksetup -listpreferredwirelessnetworks en0 |
| -removepreferredwirelessnetwork IF NAME | Forget a network | networksetup -removepreferredwirelessnetwork en0 "Home" |
| -removeallpreferredwirelessnetworks IF | Forget all networks (sudo) | sudo networksetup -removeallpreferredwirelessnetworks en0 |
Common errors
| Error | Cause | Fix |
|---|---|---|
| Network comes back after forgetting it | iCloud Keychain syncs saved networks from your other devices | Forget it on the iPhone or iPad too. |
| Error: … not found in preferred networks | Name doesn't match exactly | Copy it from -listpreferredwirelessnetworks. |
Do it in the app
LightAtom's connections view shows when connections drop and resume as your Mac switches networks.
Frequently asked questions
How do I forget a Wi-Fi network on a Mac?
System Settings › Wi-Fi › click ⋯ next to the network › Forget This Network. Your Mac stops joining it and forgets its password.
Why does a forgotten network reappear?
iCloud Keychain syncs Wi-Fi networks between your devices. Forget it on your iPhone and iPad as well.
Does forgetting a network delete the password?
It removes the network from your Mac's list so the password isn't used. You'll need to type it again to rejoin.