How to Block or Allow a WiFi Network in Windows 10

When you click on the network icon on your taskbar to connect to a WiFi network, Windows will show all the Available WiFi networks. This makes it easy to quickly choose a network and connect to it. However, if you have a lot of WiFi networks or access points near you, the network connections pop-up may look pretty cluttered, and you might have to do a lot of scrolling to find the access point you need. In those situations you can configure Windows to allow or block certain networks. This method is also helpful for blocking open WiFi networks that you don’t trust or WiFi networks that use inappropriate or unpleasant names.

Block a WiFi Network

Windows doesn’t provide any options in the Settings app or Control Panel, but you can easily block a WiFi network using the Command Prompt. To block a WiFi network, all you need is the network name or SSID. You can get a WiFi network name by looking at the network connections pop-up. (Click on the network icon in the taskbar.) When you block a WiFi network, it will no longer appear in the network connections pop-up, and you won’t be able to connect to it.

To start, search for “Command Prompt” in the Start menu, right-click on it and select the option “Run as Administrator.”

In the command prompt window, execute the below command to block the WiFi network. Replace “WiFi Network Name” with the actual SSID or network name.

As soon as you execute the command, said WiFi network will be added to the blacklist filter, and you will be no longer be able to see or connect to it.


In the future, if you want to allow the WiFi network, all you have to do is to delete the entry from the blacklist. To do that, execute the below command while replacing “WiFi Network Name” with the actual blocked network name.

If you don’t remember the actual name, then use the below command. It will list the names of all the allowed and blocked WiFi networks.


Allow a WiFi Network

Just as you can block select WiFi networks and allow all other networks, you can allow select WiFi networks and block everything else. This kind of whitelisting is useful when you want your system to only connect to the networks you trust.

Just like before, open Command Prompt with admin rights and execute the below command to allow a WiFi network. Replace “WiFi Network Name” with the actual SSID.


If you have more networks, then repeat the command while replacing the name to add more WiFi networks to the whitelist filter. Once you are done adding, use the below command to block all other not-whitelisted networks.

From this point forward, your system can only see and connect to allowed WiFi networks. If you want to block a previously allowed WiFi network, then all you have to do is delete that specific entry from the allowed list. You can do that by executing the below command.

In the future, if you decide you no longer have the need to whitelist specific networks and block all others, use the below command. It will delete the “deny all” filter and allow all WiFi networks along with the ones in the whitelist.

Comment below sharing your thoughts and experiences regarding using the above method to block or allow WiFi networks in Windows 10.

Image credit: Wireless Router by Sean MacEntee

Vamsi Krishna Vamsi Krishna

Vamsi is a tech and WordPress geek who enjoys writing how-to guides and messing with his computer and software in general. When not writing for MTE, he writes for he shares tips, tricks, and lifehacks on his own blog Stugon.


  1. Brilliant tip – thanks!
    Have Googled quite a bit since setting up a new laptop and this is the only method that has actually worked for me.
    Laptop kept connecting to a neighbour’s router with a link to pay-per-day service from their ISP.

    Most other pages (Microsoft included) just said to remove the checkmark form “Connect Automatically” which simply does not work for open networks.

    100% sorted out now. Page saved in favourites for future ref. Thanks again.

  2. Been looking for a solution to this problem for hours now and this is the only solution that worked. Microsoft does not actually have an actual solution that would stop from automatically connecting to all networks listed. My wifi now only stays connected to mine and doesn’t disconnect every 5 min trying to connect to the neighbors. Thank you, you’re the best.

  3. Says – The requested operation requires elevation (Run as administrator).

    I thought I was administrator.

    1. Even if you are an admin, you have to manually open the Command Prompt as admin. To do that, search for “cmd” in the start menu, right-click and select “Run as administrator” option.

Comments are closed.