Putting YouTube in Restricted Mode blocks adult content and makes the platform safer for your kids 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.

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. This command blocks YouTube on all browsers (Safari, Firefox, Microsoft Edge, etc.) except Google Chrome. Close Notepad and try visiting YouTube in your web browser. If you followed these steps correctly, YouTube should display a “Connect to the internet. You’re offline.” error message. If you can still open YouTube, restart your computer and try again.

Unblock YouTube in Windows

Close the hosts file in Notepad, open any web browser, and check if you can now access YouTube. Restart your computer if your browser doesn’t load YouTube.

How to Block YouTube on Your Mac

In macOS, you can block YouTube in Screen Time or by editing your Mac’s TCP/IP hosts file.

Block YouTube Using Screen Time

Screen Time on Mac computers has content restriction settings for blocking inappropriate web content. Follow the steps below to block access to YouTube on all web browsers installed on your Mac. It’s possible to bypass passcode restrictions from an administrator account. Hence, Apple recommends setting a Screen Time passcode from a standard account. If you’re using an administrator account, you’ll get a prompt to create a new administrator account on your Mac. Choose Don’t allow this user to administer this computer, create a new user account to be the administrator, and follow the prompt to create a new admin account. Otherwise, jump to step #3 if setting up Screen Time from a standard account. The next step is to set up the Screen Time passcode recovery. If you ever forget your Screen Time passcode, you can reset it using your Apple ID. Your web browsers will display a Screen Time pop-up when anyone visits YouTube on your Mac. To unblock YouTube, select the YouTube URL in the “Restricted” section and the minus (—) icon in the bottom corner. Select OK to save the settings and unblock access to YouTube on all web browsers.

Block YouTube on Mac By Tweaking macOS Hosts File

You must 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 file in Terminal (see steps #1 — #3) and delete 127.0.0.1 www.youtube.com. Press Control + O and press Return to save the hosts file.

Use Third-Party Tool

The methods above are straightforward and work on all macOS and Windows versions. Alternatively, you can block YouTube using free parental control software or your router’s admin panel.

How to Block YouTube on Your PC or Mac - 21How to Block YouTube on Your PC or Mac - 13How to Block YouTube on Your PC or Mac - 5How to Block YouTube on Your PC or Mac - 94How to Block YouTube on Your PC or Mac - 10How to Block YouTube on Your PC or Mac - 15How to Block YouTube on Your PC or Mac - 84How to Block YouTube on Your PC or Mac - 32How to Block YouTube on Your PC or Mac - 28How to Block YouTube on Your PC or Mac - 50How to Block YouTube on Your PC or Mac - 90How to Block YouTube on Your PC or Mac - 12How to Block YouTube on Your PC or Mac - 67How to Block YouTube on Your PC or Mac - 88How to Block YouTube on Your PC or Mac - 4How to Block YouTube on Your PC or Mac - 24How to Block YouTube on Your PC or Mac - 58How to Block YouTube on Your PC or Mac - 9How to Block YouTube on Your PC or Mac - 15How to Block YouTube on Your PC or Mac - 44How to Block YouTube on Your PC or Mac - 12How to Block YouTube on Your PC or Mac - 82How to Block YouTube on Your PC or Mac - 54How to Block YouTube on Your PC or Mac - 86How to Block YouTube on Your PC or Mac - 68How to Block YouTube on Your PC or Mac - 16How to Block YouTube on Your PC or Mac - 97How to Block YouTube on Your PC or Mac - 89How to Block YouTube on Your PC or Mac - 2How to Block YouTube on Your PC or Mac - 53How to Block YouTube on Your PC or Mac - 96How to Block YouTube on Your PC or Mac - 77