How to Block YouTube

With growing concern over the effect of online content on office productivity or young viewers, a number of homes and offices are implementing plans to block certain websites. YouTube, although the site also contains a wealth of high-quality and useful content, is one site often singled out for blocking, due to potentially inappropriate content. While a number of Web browser add-ons and software solutions can be used to block sites, the simplest and most cost-effective way to block a website on a Windows 8 machine is to edit the host file.

Teenage boy sitting in front of a computer monitor
Windows lets you block inappropriate websites on your machine.
credit: Ingram Publishing/Ingram Publishing/Getty Images

Make Host Files Editable

Step

Log into Windows 8 as an administrator and launch the Start Screen.

Step

Type "Windows Defender" into the search field and click on the application icon.

Step

Click on the "Settings" tab on the right and select Excluded Files and Locations from the menu on the left.

Step

Click on the "Browse" button at the top and navigate to the C:\Windows\System32\Drivers\etc directory. If Windows is installed on a drive other than C:, find the directory on the drive where you installed Windows.

Step

Select the "hosts" file in the "Etc." folder and click on the "OK" button.

Step

Click on the "Add" button in the main Windows Defender screen to exclude the file from Windows Defender protection.

Step

Click on the "Save Changes" button and close Windows Defender.

Block YouTube

Step

Launch the Windows Start Screen and type "Notepad" into the search field.

Step

Right-click on the Notepad app and select "Run as Administrator" from the options on the bottom of the screen.

Step

Click on the "File" tab in Notepad and select Open.

Step

Navigate to and open the hosts file from the directory C:\Windows\System32\Drivers\etc.

Step

Scroll to the bottom of the document and type in "127.0.0.1 youtube.com" to block YouTube.

Step

Save the changes to the file and close Notepad.