Let’s keep this brief! You want to know how to block a website. This might be for you, your kids or just to block a dodgy website.
You can also read this on Medium.
Latest Posts
How to setup MySQL Replication using SSL on Ubuntu
Let’s setup MySQL replication using SSL on Ubuntu. We’ll be using Ubuntu 22.04 LTS and…
Protected: Liminal: Why Should Small Businesses Blog in 2025?
TL;DR small businesses should blog as it shows greater activity on your website, can aid…
How to Make a WordPress Plugin in 2025
To make a WordPress plugin in 2025 requires only 3 files, the plugin PHP file,…
How to Move MySQL Database on Windows
Recently, I’ve had to move MySQL database on Windows to another drive. This was the…
Do I Have to Pay for Windows? – 6 Alternatives
I think we’ve all thought ‘Do I Have to Pay for Windows?’ when planning out…
How To Screenshot On All 3 Desktop OS’s
Knowing how to screenshot is one of the corner stones to receiving or providing technical…
Introduction
But as a TL:DR – This article is only useful is you are using Windows.
How To Block A Website On Windows
Personally, this would be my favourite method as it has a number of advantages:
- Scope – Blocking a site for your entire operating system means that the website will be unavailable for any web browser you use. Whereas blocking a site in a particular web browser would still allow other browsers and services on your machine to access the website. To set a block up for your entire network, consider using PiHole
- Ease – If you know your way around a computer, then I think it’s the easiest option as it’s simply a case of updating a single notepad
- Speed – Rather than downloading a separate program or extension, you simply set the values and save the file. So fast!
However, there are some downsides. For example: you will need to have administrator access to the machine in order to update and save the file. You might also find this method a bit too advanced if this is your first day using a computer; but how likely is that?
Enough setup, let me show you how to block websites on Windows:
Step 1
Search for notepad and right click the program, from the options displayed make sure to choose Run as administrator:

Step 2
One Notepad is open as the administrator, you need to go to File -> Open and then open the file in this location:
C:\Windows\System32\drivers\etc\hosts
It’s worth noting here that the hosts file might not show up due to the file type filtering. If this is the case, please select All Files (*) instead of Text Documents (*.txt)
Step 3
Finally, you can enter the websites you want to block. The values can be as specific as you want. But the overall goal is to send traffic destined for https://facebook.com to 127.0.0.1 which is the local linkback address. Effectively meaning the request for Facebook goes nowhere.
I’ll leave below some examples that you can add to your hosts file:
Once you’ve setup your hosts file, you can use File -> Save.
And that’s it, you should have now blocked access to whatever sites you want to the entire machine.
I hope you learnt something whilst reading this!
Enjoy! 🎉