How to Block a Website on Google Chrome Without Extensions

There are countless reasons you might need to block access to a specific website. Perhaps you are trying to minimize distractions while working from home, or maybe you need to prevent a shared family computer from accessing inappropriate content.

While the Google Chrome Web Store is full of third-party extensions designed to block websites, relying on them introduces security and privacy risks. Extensions often require permission to “read and change all your data on the websites you visit.” Furthermore, a tech-savvy child (or a sufficiently distracted adult) can simply right-click the extension icon and delete it, bypassing the block instantly.

If you are using Windows, you can block any website at the operating system level. This method requires no extensions, uses zero system resources, and requires administrative privileges to undo.

The Hosts File Method (Windows Only)

Every Windows computer has a hidden, plain-text file called the “hosts file.” Before your browser asks a DNS server how to find a website like facebook.com, it checks the local hosts file first. By editing this file, we can deliberately point a website’s domain name to a digital dead-end.

Step 1: Open Notepad as an Administrator

Because the hosts file is a core system component, Windows will not let you save changes to it unless you are running your text editor with elevated administrative privileges.

  1. Click the Start Menu (Windows icon) on your taskbar.
  2. Type the word Notepad.
  3. Instead of clicking the Notepad icon directly, look at the right-hand menu pane and click Run as administrator.
  4. When the User Account Control pop-up appears asking if you want to allow this app to make changes to your device, click Yes.

You now have a blank Notepad document open with the necessary permissions to edit system files.

Step 2: Locate the Hosts File

  1. In Notepad, click File in the top left corner, then click Open…
  2. Navigate to your main hard drive (usually Local Disk (C:)).
  3. Open the Windows folder, then the System32 folder, then the drivers folder, and finally the etc folder.
  4. When you open the “etc” folder, it will appear empty. This is because Notepad is only looking for standard text files (.txt).
  5. In the bottom right corner of the open dialogue box, change the drop-down menu from Text Documents (*.txt) to All Files (*.*).
  6. The hosts file will now appear. Click it and select Open.

Step 3: Add the Block Rules

You will now see a document filled with text, most of which begins with a hash symbol (#). These are just instructional comments left by Microsoft.

  1. Scroll down to the very bottom of the document, below all the existing text.
  2. Create a new line.
  3. Type 127.0.0.1 followed by a single space. (127.0.0.1 is the universal IP address for “localhost,” which essentially means “this computer”).
  4. Type the URL of the website you want to block (e.g., facebook.com).
  5. Create another new line and repeat the process, adding the “www” prefix just to be safe.

For example, if you want to completely block Facebook, the bottom of your hosts file should look exactly like this:

127.0.0.1 facebook.com
127.0.0.1 www.facebook.com

You can add as many websites as you like, making sure each website gets its own dedicated line.

Step 4: Save and Test

  1. Once you have added all your target websites, click File > Save. (Do not click “Save As”).
  2. Close Notepad.

Open Google Chrome and attempt to navigate to the website you just blocked. Instead of loading the page, Chrome will immediately display an error message stating “This site can’t be reached.” The block applies system-wide, meaning it will also prevent Edge or Firefox from accessing the site.

To unblock the website later, simply repeat the process, open the hosts file as an administrator, delete the lines you added, and save the file again.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.