How to Block YouTube on Your Computer

Techwalla may earn compensation through affiliate links in this story.
Image Credit: martin-dm/E+/GettyImages

If YouTube is taking up too much of your time or you do not want your kids to browse the website, then it may be time to block YouTube on your computer. Whether you have a Windows or Mac computer, you will find that there are several options for blocking YouTube and other websites from being viewed.


Block With Windows Hosts File

Windows users can block YouTube and other websites on a computer by using the hosts file, which stores hostnames with associated IP addresses for those names. The file typically isn't edited unless you use it specifically to block a website. You can block YouTube on your PC with the hosts file by navigating in your Windows folder to C:\Windows\System32\drivers\etc and double-clicking the hosts file in that folder to open it in Notepad. Type "" at the end of this file to block all traffic from YouTube. Click or press "File" and then "Save" to save the updated hosts file on your computer. You can unblock YouTube by removing this text from the file and then saving it.


Video of the Day

Block YouTube With Windows Software

The Windows hosts file method of blocking a site can be a bit confusing for the average PC user. You may prefer to use another method for blocking YouTube on your computer by using Windows software. Free software options for blocking YouTube and other websites on a computer include Cold Turkey Blocker, Web Blocker and StayFocusd. Paid software options for blocking YouTube include FocusBooster, FocusMe, Net Nanny and Barracuda Web Filter.

Block YouTube With Mac Terminal

Mac users can block YouTube and other websites by using the OS X and macOS versions of the hosts file. The OSX hosts file is hidden and can be best accessed and edited by using the Mac Terminal. Access the Terminal by clicking the magnifying glass in the top right corner of your Mac and then typing "Terminal" and pressing the "Return" key to open it.


Type "sudo nano /etc/hosts" (without quotation marks) into the Terminal window and press the "Return" key. Type in your Mac administrator password and then press "Return" to open the hosts file. Press the down-arrow key to go to the bottom of the hosts file and then type in "" and press the "Return" key to block the website. Press the "Control" and "O" keys to save the changes. Press "Return" and then the "Control" and "X" keys to exit the file. Type "sudo dscacheutil -flushcache" and press "Return" to complete the changes and block YouTube on your computer.


Block YouTube With Mac Programs

Mac users who do not want to mess around with the Terminal or who are looking for advanced blocking options may find using a Mac program to block YouTube to be the best option. Many Mac programs on the market block specific websites from being accessed. Free Mac program options include SelfControl, Cold Turkey Blocker, FocalFilter and RescueTime. Paid Mac program options for blocking YouTube and other websites include Freedom, Focus by Brad Jasper and Net Nanny.

Use YouTube Parental Controls

You don't have to totally block YouTube from your kids as you can setup YouTube parental controls on the Android and iOS YouTube apps. YouTube parental controls allow parents to pick the channels and videos that their kids are allowed to watch. Enable YouTube parental controls by opening the "Settings" section of the YouTube app and then tap on your child's profile. Tap "Approved content only" and then select what videos and channels are allowed by tapping the "+" button next to each one.