[ad_1]
YouTube is home to unlimited educational and entertainment content. However, you may want to block YouTube on your personal or home computer if the site becomes too distracting.
Putting YouTube in Restricted Mode blocks adult content and makes the platform safer for your children or teenage children. You can also block specific channels with inappropriate content. But if you want to block access to the YouTube website on your computer, we’ll show you how it’s done. This tutorial covers steps for Mac and Windows computers.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-1-compressed.jpg)
Block YouTube on Windows PC
You can block websites by modifying the “Hosts file” that Windows uses to configure your computer’s Transmission Control Protocol/Internet Protocol (TCP/IP). TCP/IP describes a set of instructions that dictate how your computer exchanges data over the Internet.
Follow the steps below to block YouTube by editing the Windows hosts file in Windows 10 or 11.
- Open the Windows File Explorer (Windows key + E), paste C:\Windows\System32\drivers\etcand press Get in.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-2-compressed.png)
- Double click the hosts file.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-3-compressed.png)
- Choose Notepad and select ok.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-4-compressed.jpg)
- Scroll to the bottom of the page and press Get in to go to a new line. type 127.0.0.1press the spacebartype www.youtube.comand press Get in move to the next line.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-5-compressed.png)
This command blocks YouTube on all browsers (Safaro, Firefox, Microsoft Edge, etc.) except Google Chrome.
- type 127.0.0.1press the spacebartype youtube.comand press the spacebar again. This command prevents your computer’s Google Chrome browser from accessing YouTube.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-6-compressed.png)
- press Ctrl + Shift + Sor choose File in the upper right corner and select Save as.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-7-compressed.png)
- Choose All files in the “Save as type” drop-down menu. Then, select the hosts file in the destination folder and select to save.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-8-compressed.png)
- Choose Yes on the popup window.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-9-compressed.png)
Close Notepad and try visiting YouTube in your browser. If you followed these steps correctly, YouTube should display “Connecting to the internet. You are offline.” error message If you can still open YouTube, restart your computer and try again.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-10-compressed.jpg)
Unblock YouTube on Windows
- Return to the host file destination (Local disk (C:) > Windows > System 32 > drivers > etc) and open the hosts file with Notepad.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-11-compressed.png)
- Remove the IP address and URL(s) of the YouTube website in the last line of the document.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-12-compressed.png)
- press Ctrl + S to save the hosts file. Alternatively, select File on the menu bar, and select to save.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-13-compressed.png)
Close the hosts file in Notepad, open any browser and check if you can now access YouTube. Restart your computer if your browser does not load YouTube.
How to Block YouTube on Your Mac
On macOS, you can block YouTube in Screen Time or by editing your Mac’s TCP/IP hosts.
Block YouTube Using Screen Time
Screen Time on Mac computers has content restriction settings to block inappropriate web content. Follow the steps below to block access to YouTube on all browsers installed on your Mac.
- open up System Preferences and select Screen Time.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-14-compressed.jpg)
- Choose Options in the lower-left corner and check the Use Screen Time Passcode option
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-15-compressed.jpg)
It is possible to bypass password restrictions of an administrator account. That’s why Apple recommends setting a Screen Time password from a standard account.
If you’re using an administrator account, you’ll be prompted to create a new administrator account on your Mac. Choose Do not allow this user to manage this computer, create a new user account to be the administrator, and follow the prompt to create a new administrator account.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-16-compressed.jpg)
Otherwise, skip to step #3 if setting Screen Time from a standard account.
- Enter a four-digit Screen Time passcode.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-17-compressed.jpg)
- Re-enter the four-digit Screen Time passcode to proceed.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-18-compressed.jpg)
The next step is to set up Screen Time password recovery. If you ever forget your Screen Time passcode, you can reset it using your Apple ID.
- Enter your Apple ID email and password and select Later.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-19-compressed.jpg)
- Choose Content and Privacy in the Screen Time settings menu and select Restrict Adult Sites.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-20-compressed.jpg)
- Enter your Screen Time passcode.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-21-compressed.jpg)
- Choose set up.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-22-compressed.jpg)
- Select the more icon (+) in the lower corner of the block list.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-23-compressed.jpg)
- Get in https://youtube.com in the URL dialog box and select ok.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-24-compressed.png)
- Choose ok to save the restriction.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-25-compressed.jpg)
Your web browsers will display a screen time of Screen Time when anyone visits YouTube on your Mac.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-26-compressed.jpg)
To unblock YouTube, select the YouTube URL in the “Restricted” section and the minus (—) icon in the lower corner. Choose ok to save the settings and unblock access to YouTube on all browsers.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-27-compressed.jpg)
Block YouTube on Mac By adjusting the macOS Hosts File
- Go to finder > Applications > Utilities and double click Terminal.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-28-compressed.jpg)
- Type or paste sudo nano /etc/hosts in the Terminal console and press come back.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-29-compressed.png)
- Enter your Mac’s password and press come back.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-30-compressed.png)
- Type or paste 127.0.0.1 www.youtube.com in the last line. Then, press Control + oh and press come back to save the hosts file.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-31-compressed.jpg)
- Close the Finaster window, clear your browser’s cache and check if YouTube is blocked.
You should clear your browser’s cache after editing the hosts file in Terminal. Otherwise, you and other users will still be able to access YouTube.
To unblock YouTube, reopen the hosts files in Terminal (see steps #1 — #3) and remove 127.0.0.1 www.youtube.com. press Control + oh and press come back to save the hosts file.
![](https://www.online-tech-tips.com/wp-content/uploads/2022/10/how-to-block-youtube-on-your-pc-or-mac-32-compressed.jpg)
Use a Third Party Tool
The above methods are simple and work on all versions of macOS and Windows. Alternatively, you can block YouTube using free parental controls or your router’s admin panel.
[ad_2]
Source link