Delete Wi-Fi network from mac How do I delete a network from my Mac?

I removed it from network preferences in the advanced pane but it still appears connected in my list. 

I also tried looking for it in Keychain Access but it's not there and I'm still connected.
Disconnect from your current network:

sudo /System/Library/PrivateFrameworks/Apple80211.framework/V*/A/R*/airport -z

Go to System Preferences → Network → Wi-Fi → Advanced… and remove the network from the list of preferred networks.