How to disable/enable automatically connecting to WiFi?

I'm updating this answer to reflect new images, since this was done on a laptop.

Click on the wireless icon on the top bar as shown in the image below, and

enter image description here

Then clock on Edit Connections.

enter image description here

Once the window opens, click on the wireless tab, and then click on the Edit button.

enter image description here

Unckeck the connect automatically radio button, and click Save. At this point you need to reboot your system

enter image description here

Once rebooted, you can see from the image below, that the wireless network is not connected. You have to enable it to be able to use it.

enter image description here

Now the wireless network can be enabled/disabled from terminal, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below to list all devices.

rfkill list

To block wireless, you type:

rfkill block <device_number>

To unblock you type:

rfkill unblock <device_number>

as shown in the image below.

enter image description here


Click on Wi-fi Icon >> Edit Connections >> Then, Click On Wireless Tab, Delete The Wireless Connections That You Don't want to Use or You Want Ubuntu To Stop Automatically Connecting To Them.