There are many reasons why you might want to block access to certain websites. Perhaps you want to ensure that children do not access inappropriate content, or you want to increase your productivity by staying away from distracting sites. In this guide, you will learn how to easily block access to websites like YouTube on Windows.

Key Takeaways

  • You can block websites on your PC with a few simple steps.
  • The blocking is done through your system's host file, denying access to unwanted sites.
  • If you encounter functionality issues, it may be necessary to disable antivirus software.

Step-by-Step Guide

First, open the Windows bar. To do this, click on the Windows symbol in the lower left corner of your screen.

Then navigate to "Documents". Once there, you need to select the hard drive where Windows is installed. Usually, this is the C drive.

After opening the C drive, look for the "Windows" folder. Double click to open it. Scroll down until you find the "System32" folder.

Efficiently block websites on a Windows PC

In the "System32" folder, you will find another folder named "drivers". Go into this folder as well.

Efficiently block websites on a Windows PC

Within the "drivers" folder, select the "etc" folder. You may not see any files in this folder initially.

Efficiently block websites on a Windows PC

To make the files visible, click on the selection option for "Text files" in the lower right corner. You should now be able to see the files. Select the "hosts" file and click on "Open".

Efficiently block websites on a Windows PC

The "hosts" file will now open in the text editor. Here you can deny access to specific websites. Click at the end of the file on the last letter and press the Enter key.

Efficiently block websites on a Windows PC

Now enter the IP address "127.0.0.1" as shown above. Then press the Tab key and enter the URL of the website you want to block. For example, "youtube.com".

Efficiently block websites on Windows PC

Now open your web browser to copy the full URL. If you want to block YouTube, enter "youtube.com". Copy this line with a right-click.

Efficiently block websites on a Windows PC

Go back to the "hosts" file and paste the copied URL using the key combination "Ctrl + V". Before this URL, add "www.".

Efficiently block websites on Windows PC

Now it's time to save the changes. Click on "File" and select "Save".

After closing the editor, open your web browser again. If you try to access YouTube now, you should see an error message indicating that you are offline or unable to connect to the internet.

Efficiently block websites on a Windows PC

If the blocking does not work, you can try disabling your antivirus program temporarily. Sometimes these programs block the changes you make to the "hosts" file.

If you want to lift the block, open the "hosts" file again, highlight the two lines related to the website, and press the Delete key. Then save the file again.

Now you have access to YouTube or the other sites you had previously blocked at any time.

Summary

This guide shows you, step by step, how you can effectively block websites on your Windows PC. With simple changes to the "hosts" file, you can control access to unwanted sites and ensure that certain content is blocked. Remember, you can also undo the changes if needed.

Frequently Asked Questions

How can I undo blocking a site?Open the "hosts" file, delete the added lines, and save the file.

What to do if the blocking is not working?Temporarily disable your antivirus program and check if it is causing the issue.

Which websites can I block?You can block any website by adding its URL to the "hosts" file.

Do I need administrator rights to edit the hosts file?Yes, you need to run the editor as an administrator to make changes to the "hosts" file.