How to Block YouTube on Windows PC (All Methods)

Block YouTube on Windows using Microsoft Family Safety, the hosts file, browser extensions, and Windows parental controls. Includes beginner and advanced methods.

Last updated 11 April 2026ยท
Difficulty๐Ÿ”จ๐Ÿ”จ๐Ÿ”จ
Free
Bypass risk๐Ÿน๐Ÿน๐Ÿน๐Ÿน๐Ÿน

Overview

Windows gives you several overlapping ways to block YouTube โ€” use more than one for the strongest result:

  1. Microsoft Family Safety โ€” web filtering, screen time, app controls (easiest, recommended first)
  2. Hosts file โ€” OS-level block, survives browser changes (intermediate)
  3. Browser extensions โ€” per-browser block (supplement, not standalone)
  4. YouTube UWP app โ€” block the Windows Store app

Start with Method 1. Add Methods 2 and 3 on top 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.

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 โ€” do not let them use your account.

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 โ†’ Web Browsing

Tap Content Filters โ†’ Web โ†’ toggle on Filter inappropriate websites and searches.

Add YouTube to the blocked sites list

Under Blocked sites, click Add a website and add:

  • youtube.com
  • youtu.be
  • music.youtube.com

Click the checkmark to save each one.

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, games & media โ†’ toggle on Block inappropriate apps, games and media.

Block the YouTube app from the Microsoft Store

The YouTube Windows app (UWP) is available in the Microsoft Store. In Family Safety โ†’ Content Filters โ†’ Apps/Games โ†’ find YouTube in the list and block it. Alternatively, set app purchases to require parental approval.

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:

  1. Open Chrome โ†’ go to the Chrome Web Store โ†’ search "BlockSite"
  2. Install BlockSite โ€” Block Websites & Stay Focused
  3. Open BlockSite options โ†’ Add YouTube.com to the block list
  4. Set a BlockSite password so they can't remove it: BlockSite โ†’ Settings โ†’ Password Protection

uBlock Origin (custom filter):

  1. Install uBlock Origin from the Chrome Web Store
  2. Open uBlock Origin dashboard โ†’ My Filters tab
  3. Add these lines to block YouTube:
  1. Click Apply changes
โš ๏ธ

Extensions can be removed unless you lock Chrome

Any Chrome extension can be removed from the Extensions menu. To prevent this, use Microsoft Family Safety's app restrictions, or enable Chrome's managed user profile via Google Family Link.

Firefox โ€” uBlock Origin

Same as Chrome above, but install uBlock Origin from the Firefox Add-ons store (addons.mozilla.org).

To prevent extension removal in Firefox: Open Firefox โ†’ type about:config in the address bar โ†’ search extensions.allowPrivateBrowsingByDefault and review extension management policies.

Edge โ€” Built-in content filter

Microsoft Edge has a built-in content filter for Family Safety child accounts. If they're logged into Windows as their child account, Edge's content filters from Family Safety apply automatically โ€” 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. The blocks still apply.

Other browsers: Family Safety web filtering applies to Edge and Chrome on Windows. It does NOT automatically apply to Firefox or Brave. Block installing new browsers via Microsoft Store restrictions, and check for downloaded browser installers in their Downloads folder.

VPN apps: A VPN bypasses the hosts file and DNS-based filters. Block VPN software: in Family Safety โ†’ Apps/Games โ†’ find any VPN software and block it. Also check their Downloads folder for VPN installers.

Switching to a local account: If they log out and switch to a local (offline) Windows account, Family Safety doesn't apply. Prevent local account creation: Settings โ†’ Accounts โ†’ Other users โ†’ remove any local accounts. Password-protect your admin account.

Browser sync: If they have Chrome signed into a secondary Google account on another device, their bookmarks and history sync โ€” including YouTube bookmarks. This doesn't bypass the block, but it's worth knowing they may have workaround ideas synced from a less-restricted device.

๐Ÿ”จ

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: These two together cover almost all bypass paths. The hosts file works even if they find a way to disable a browser extension. Family Safety works even if they find a browser the hosts file is failing to block for some reason (it covers DNS-level filtering too).

Add DNS filtering on the router: CleanBrowsing or NextDNS at the router level catches YouTube on any device โ€” including if they bring a personal phone and connect to your Wi-Fi.

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.

Want a personalised plan?

Answer 5 questions and get a guide for every device your child uses.

Take the Quiz โ†’
Take the Quiz โ†’