Guides/Device setup
How to block YouTube on Windows
Use Microsoft Family Safety or a Windows hosts file to block YouTube. See what each method covers and when a YouTube filter fits better.
Updated Aug 10, 2026 · 6 min read
The short answer
Windows has no single YouTube switch.
Use Microsoft Family Safety if your child uses Microsoft Edge with a child Microsoft account. Use the Windows hosts file if you want the main YouTube site blocked for every user and browser on one PC.
If your child still needs YouTube for class or hobbies, a full site block may be too broad. In that case, keep the site and set rules inside YouTube instead.
Option 1: block YouTube with Microsoft Family Safety
This is the cleanest built-in choice for one child. Microsoft says its web and search filters work only in Edge while the family member is signed in to their Microsoft account. The rule does not follow them into Chrome or Firefox.
First, add the child as a Member in your Microsoft family group at family.microsoft.com. Then set the site rule:
- 1
Open Microsoft Family Safety, select your child, and open their overview.
- 2
Select Edge as the platform, then turn on Filter inappropriate websites and searches.
- 3
Under Blocked sites, add
youtube.com. Test bothyoutube.comandwww.youtube.comfrom your child's Edge account. - 4
In App and game filters, block other browsers if the YouTube block must hold.
Microsoft keeps the current labels in its Family Safety web filter guide.
This method targets the child, not every Windows user. It is a better fit than the hosts file on a shared family PC.
Option 2: block YouTube with the Windows hosts file
The hosts file changes how Windows finds a domain. A rule there applies to every browser and every user on that PC.
Know the limit
This block is easy for an administrator to undo. Give your child a standard Windows account and keep your administrator password private.
- 1
Sign in to your administrator account. In File Explorer, open
C:\Windows\System32\drivers\etcand copy thehostsfile to your desktop. - 2
Open the copy in Notepad. Add
127.0.0.1 youtube.com,127.0.0.1 www.youtube.com, and127.0.0.1 m.youtube.comon separate lines. - 3
Save the file with the name
hostsand no file extension. Keep a backup of the old file, then move the edited file back into theetcfolder. Windows will ask for administrator approval. - 4
Close every browser window and test YouTube from the child's account. Add
music.youtube.comonly if you also want to block YouTube Music.
Microsoft explains the file location and format in its hosts file guide.
The hosts file is a PC-wide block. It does not block the YouTube app on a phone, tablet, TV, or console. It can also affect videos embedded on other sites.
Keep YouTube but filter what your child sees
Vidward is the less blunt option. It is a desktop browser extension plus a parent dashboard. You can block channels, single videos, and title words. You can also remove Shorts and keep autoplay off.
Install it inside the Chrome profile your child uses, link that browser with the activation code from your dashboard, then add the rules that fit your family. The child keeps normal YouTube for the content you allow.
Vidward does not block YouTube in phone or tablet apps. It does not filter a TV, console, or your home network. Its rules apply where the extension runs.
For Chrome setup details, read how to block YouTube in Chrome. If only one Windows user needs the rule, read how to block YouTube for one user account.
Which Windows method should you use?
- One child who uses Edge: use Microsoft Family Safety.
- Every account and browser on one PC: use the hosts file.
- One child still needs some of YouTube in Chrome: use Vidward.
- Every device on your wifi: use a router or DNS filter. Vidward does not do this.