How to Block YouTube on a Windows PC or Laptop
Block YouTube on a Windows 10 or 11 PC or laptop with Microsoft Family Safety, the hosts file and browser extensions. Covers Chrome, Store apps and bypasses.
Overview
The quickest way to block YouTube on a Windows PC is Microsoft Family Safety: give your child their own Standard (not Administrator) child account, then add youtube.com to their Blocked sites. Add the hosts file on top and YouTube stays blocked even if they get another browser working. Here are the options, easiest first:
- Microsoft Family Safety - web filtering, screen time, app controls (easiest, start here)
- Hosts file - system-level block that works in every browser (intermediate)
- Browser extensions - per-browser block (a supplement, not a standalone fix)
- Windows Defender Firewall - advanced, and fiddly to maintain
Start with Method 1. Add Method 2 for a layered defence.
Method 1: Microsoft Family Safety (Easiest, Start Here)
Microsoft Family Safety is free and built into Windows 10 and 11. It lets you block websites, set screen time limits and restrict app downloads, all managed from a phone app or website. For the full walkthrough, see the Microsoft Family Safety guide.
Step 1: Set Up a Child Account on Windows
Sign in to your own Microsoft account on the PC
If you don't have one, create one at account.microsoft.com. Your child needs their own separate account. Don't let them use yours.
Create a child Microsoft account
Go to account.microsoft.com/family and sign in. Click Add a family member โ Create an account for a child. Follow the prompts. Microsoft will send a verification email.
Add the child account to the Windows PC
On the PC: Settings โ Accounts โ Family & other users โ Add a family member. Sign in with the child account credentials. The account now appears on the Windows login screen.
Make sure they log in with their account - not yours
Set a strong password on your own Windows account. Go to Settings โ Accounts โ Sign-in options and enable a PIN or password. Never let your child use your admin account.
Step 2: Block YouTube in Family Safety
Open Family Safety on your phone or go to family.microsoft.com
Download the Microsoft Family Safety app (iOS or Android) or go to family.microsoft.com in a browser.
Select your child's account
You'll see their account in your family group. Tap their name.
Go to Content filters and turn on web filtering
Tap Content filters (on the website, open your child's overview and choose Edge) โ toggle on Filter inappropriate websites and searches. With this on, Microsoft says unsupported browsers are blocked "so that filtering cannot be bypassed" (Microsoft Support).
Add YouTube to the blocked sites list
Under Blocked sites, click Add a website and add:
youtube.comyoutu.bemusic.youtube.com
Save each one. These are blocked in Edge whenever your child is signed in with their Microsoft account.
Optionally enable the approved-sites-only mode
Toggle on Only use allowed websites. Now only sites you've explicitly approved are accessible. This is the most restrictive option and suitable for younger children.
Step 3: Restrict App Downloads and the YouTube UWP App
Block app purchases in Family Safety
In Family Safety โ Content filters โ Apps and games, set an age limit for apps and games. Anything above it needs your approval.
Block the YouTube app from the Microsoft Store
If a YouTube app or a YouTube wrapper app shows up from the Microsoft Store, block it under Apps and games in Family Safety. Keeping an age limit on means new installs above it come to you for approval first.
Check for the YouTube app and uninstall it
On the Windows PC: Start menu โ search "YouTube" โ if an app appears, right-click โ Uninstall. With app restrictions on, they won't be able to reinstall it.
Method 2: Edit the Windows Hosts File (Intermediate - Survives Browser Changes)
The hosts file is a system file that maps domain names to IP addresses before any DNS lookup happens. Adding YouTube to the hosts file redirects it to 127.0.0.1 (nothing) - regardless of which browser is used.
Protect the hosts file after editing
After editing the hosts file, make it read-only so it can't be easily changed without admin access. Instructions in Step 5 below.
Open Notepad as Administrator
Press the Windows key, type Notepad. Right-click on Notepad in the results โ Run as administrator. Click Yes on the UAC prompt.
Open the hosts file
In Notepad: File โ Open. Navigate to C:\Windows\System32\drivers\etc\. Change the file type filter from "Text Documents" to "All Files". Select the file named hosts (no extension) and click Open.
Add YouTube entries at the bottom of the file
Scroll to the end of the file. Add these lines (leave a blank line before them):
The last three entries block the YouTube API and thumbnail CDN - useful for stopping YouTube embeds in other pages.
Save the file
File โ Save (Ctrl+S). If it says "Access Denied", you didn't open Notepad as Administrator - close and repeat Step 1.
Make the hosts file read-only
In File Explorer, navigate to C:\Windows\System32\drivers\etc\. Right-click hosts โ Properties โ tick Read-only โ OK. Now the file can't be edited without first removing the read-only attribute (which requires admin rights).
Flush the DNS cache
Press Windows + R, type cmd, press Enter. In the command prompt, type ipconfig /flushdns and press Enter. The block takes effect immediately.
Method 3: Browser Extensions
Browser extensions add a per-browser block. They're easier to set up than the hosts file but easier to remove too - use them as a supplement, not a standalone method.
Chrome - BlockSite or uBlock Origin
BlockSite:
- Open Chrome โ go to the Chrome Web Store โ search "BlockSite"
- Install BlockSite - Block Websites & Stay Focused
- Open BlockSite options โ Add YouTube.com to the block list
- Set a BlockSite password so they can't remove it: BlockSite โ Settings โ Password Protection
uBlock Origin (custom filter):
- Install uBlock Origin from the Chrome Web Store
- Open uBlock Origin dashboard โ My Filters tab
- Add these lines to block YouTube:
- Click Apply changes
Extensions can be removed
Any extension can be removed from the browser's Extensions menu. A password-protected blocker helps, but a determined kid can still uninstall the browser's extension or switch browsers, so treat this as a backup layer.
Firefox - uBlock Origin
Same as Chrome above, but install uBlock Origin from the Firefox Add-ons store (addons.mozilla.org).
Edge - Built-in content filter
Edge is the browser Family Safety actually filters. If your child signs in to Windows and Edge with their child account, your blocked sites apply automatically, including in InPrivate windows. No extension needed.
Method 4: Windows Defender Firewall (Advanced)
For technically confident parents, you can create a Windows Firewall rule to block outbound connections to YouTube's IP ranges.
This is an advanced method
YouTube uses many rotating IP addresses via Google's CDN. IP-based blocking is harder to maintain than domain-based methods. Use the hosts file method first - it's simpler and more reliable for most setups.
Open Windows Defender Firewall with Advanced Security
Press Windows + R โ type wf.msc โ Enter.
Create an outbound rule
Click Outbound Rules โ New Rule โ Custom โ All programs โ Any port type โ under Which remote IP addresses add Google's YouTube IP blocks (look up current YouTube ASN ranges) โ set action to Block the connection โ name it "Block YouTube".
How Kids Bypass This
Deleting the hosts file entries: If your child has admin rights on their Windows account, they can edit the hosts file themselves. Prevent this by ensuring their Windows account is a Standard User, not an Administrator.
Incognito/Private browsing: private browsing doesn't bypass the hosts file or Family Safety filters. It just doesn't save history.
Other browsers: Family Safety only filters Edge. With web filtering on, it blocks known browsers like Chrome and Firefox and your child can tap Ask to use. If you approve one, YouTube opens in it freely, so only approve another browser if the hosts file or DNS filtering is also in place. Less common browsers may not be recognised, so check their Downloads folder for installers.
"Chrome keeps closing": that's Family Safety doing its job. In 2025 a bug also blocked new versions of browsers parents had already approved; Microsoft rolled out a fix from early February 2026 (BleepingComputer). If your child says Chrome is "broken", now you know why.
VPN apps: a VPN can bypass the hosts file and DNS-based filters. Block any VPN software in Family Safety under Apps and games, and check their Downloads folder for installers. A Standard user account stops most installers from running without your password.
Switching to a local account: Family Safety doesn't apply to a local (offline) Windows account. Remove any spare local accounts under Settings โ Accounts โ Other users, and password-protect your admin account so they can't create new ones.
Browser secure DNS: Chrome, Edge and Firefox can use their own encrypted DNS, which can skip router DNS filtering. The hosts file still applies in most cases, but keep an eye on browser settings if a block mysteriously stops working.
Counter-Measures
Set child account as Standard User (not Administrator): this is the most important step. A Standard User can't edit the hosts file, install software to Program Files, or change system settings. Go to Settings โ Accounts โ Family & other users โ click the child account โ Change account type โ Standard User.
Password-protect your admin account: Use a password or PIN that your child doesn't know on your own Windows account. Without admin rights, they can't undo most of your blocks.
Combine hosts file + Family Safety: together these cover most bypass paths. Family Safety filters Edge and blocks other browsers; the hosts file blocks YouTube even if a browser gets approved or slips through.
Add DNS filtering on the router: NextDNS, with YouTube on its block list, at the router level catches YouTube on any device on your Wi-Fi, including a personal phone. See the DNS filtering guide.
Check Task Scheduler: Advanced kids sometimes schedule a task to re-enable something you've blocked. Periodically check Windows Task Scheduler (search "Task Scheduler" in Start) for any unfamiliar tasks.
Related Guides
Block YouTube with Microsoft Family Safety (Windows & Xbox)
Block YouTube with Microsoft Family Safety on Windows 10/11 and Xbox: blocked sites, the Chrome question, app limits and screen time. Free to use.
By DeviceHow to Block YouTube on a Mac or MacBook (macOS 27 and Older)
Block youtube.com and YouTube web apps on your child's Mac with free Screen Time controls, a Standard user account and browser lockdown. macOS 27 steps.
By DeviceHow to Block YouTube on Xbox (Series X/S and Xbox One)
Block YouTube on Xbox Series X/S and Xbox One: block the app, lock down the Edge browser and set screen time with free Microsoft family settings.
By DeviceHow to Block YouTube on a Chromebook (Family Link & School)
Block YouTube on a personal or school Chromebook. Use Family Link to block youtube.com in Chrome and the YouTube Android app, and close the Guest mode gap.
You Might Also Need
Device-level blocking works best when paired with a network-level block.
Block YouTube with DNS Filtering on Your Home Wi-Fi
Which DNS filters actually block YouTube (most free ones don't), how to set one on your router, and how to stop kids bypassing it with secure DNS or a VPN.
Block YouTube on Any Router: Generic Parental Controls Guide
Block YouTube on any home router: find the admin panel, use URL filtering or a DNS filter that really blocks YouTube, and close the mobile data and VPN gaps.
Want a personalised plan?
Answer 5 questions and get a guide for every device your child uses.
Take the Quiz โ