How to block YouTube on Windows

Sameed Ahmad
By Sameed Ahmad, who builds Focus AI (so read the Focus AI parts with that in mind).
Updated December 2026

To block YouTube on Windows 10 or Windows 11, choose between three proven methods: editing C:\Windows\System32\drivers\etc\hosts as Administrator followed by ipconfig /flushdns (free across Chrome, Edge, and Firefox), configuring Microsoft Family Safety for a child's Windows login (great for blocking both sites and Windows desktop apps), or installing Focus AI inside Chrome, Microsoft Edge, Brave, or Firefox. Adding youtube.com, www.youtube.com, m.youtube.com, youtu.be to the Windows hosts file stops YouTube system-wide without extra software, though anyone with Windows Administrator rights can delete those lines in seconds. For adults, remote workers, and parents on Windows, Focus AI adds Always-On Site Blocker (up to 3 sites free, unlimited Pro), Quit Wall strict mode, and Friend/Parent Passcode Lock.

1. Block YouTube on Windows 10 & 11 via the hosts file (free)

  1. Open the Windows Start Menu, search for Notepad, right-click it, and click Run as administrator.
  2. Click File > Open, navigate to C:\Windows\System32\drivers\etc\, change the bottom-right dropdown from Text Documents (*.txt) to All Files (*.*), and open hosts.
  3. Paste the exact 127.0.0.1 and ::1 lines for YouTube shown below at the bottom of the file, then press Ctrl + S to save.
  4. Open Command Prompt and run ipconfig /flushdns, then close and reopen Chrome, Edge, or Firefox.

2. Block YouTube on Windows for kids with Microsoft Family Safety

  1. Ensure your child signs into Windows with a Standard (non-Administrator) Microsoft child account.
  2. Sign in at family.microsoft.com from your parent account, select the child, and open Content filters > Web and search.
  3. Enable web filtering, add youtube.com under Blocked sites, and block unmonitored browsers or desktop game launchers under Apps and games.

3. Block YouTube on Windows Chrome, Edge, Brave, or Firefox with Focus AI

  1. Install Focus AI from the Chrome Web Store (works natively in both Chrome and Microsoft Edge) or Mozilla Add-ons (Firefox).
  2. Enable Allow in Incognito (Chrome) or Allow in InPrivate (Edge) inside your browser's extensions page.
  3. Add youtube.com to Always-On Site Blocker (free for up to 3 sites) or run context-aware AI focus sessions, with optional Friend/Parent Passcode Lock on Pro.

Exact YouTube domains & subdomains (hosts file block)

Hosts-file blocking kills youtube.com everywhere, including embedded training videos inside course portals and Notion docs.

127.0.0.1 youtube.com
::1 youtube.com
127.0.0.1 www.youtube.com
::1 www.youtube.com
127.0.0.1 m.youtube.com
::1 m.youtube.com
127.0.0.1 youtu.be
::1 youtu.be
Need multiple sites? Open the free Hosts File Website Blocker Generator →
Interactive Demo · Zero Install

Try Focus AI live against YouTube

Pick or type a real work task, then test any URL to see what stays open and what gets blocked.

youtube.com/watch?v=nextjs-app-router-guide

This YouTube video matches your task "Building Next.js app", so Focus AI lets it play while keeping Shorts blocked.

ALLOWED
Session check log for “Building Next.js app”
Simulated client-side demo. In Chrome, Focus AI runs live on every tab during active sessions.Add Focus AI to Chrome
Windows loopholes & reality check

What breaks YouTube blocks on Windows

On Windows 10 & 11, watch two common bypasses: Microsoft Family Safety's native web filter only filters Microsoft Edge unless you also block Chrome and Firefox under Family Safety App Limits, and Chrome/Edge Secure DNS (DoH) can ignore your Windows hosts file until Secure DNS is turned off.

YouTube's trap is rarely the tutorial you searched for; it is the sidebar recommendations, autoplay queue, and homepage grid engineered to keep you watching long after your question was answered.

Privacy & pricing: Focus AI checks only the URL and brief page snippet during active sessions. Banking, login, email, and form inputs are skipped. Nothing is stored as browsing history or sold. Free for 3 AI focus sessions and up to 3 always-blocked sites, then $4.99/week, $14.99/month, or $79/year (save 56%).
FUTURE YOU IS WATCHINGLOCK IN

Block YouTube on Windows and keep it blocked

Start free with 3 AI focus sessions and up to 3 always-blocked sites. Upgrade anytime for Friend/Parent Passcode Lock and unlimited protection.

Add Focus AI to Chrome
Free for 3 AI focus sessions + 3 always-blocked sites · 30-second setup · No account needed

Frequently asked questions

Why does Windows block me from saving the hosts file for YouTube?

You must open Notepad via Right-Click > Run as administrator. If saving still fails, check whether your antivirus software temporarily locks C:\Windows\System32\drivers\etc\hosts against edits.

Does Microsoft Family Safety block YouTube in Chrome on Windows?

No. Microsoft Family Safety web filtering enforces natively in Microsoft Edge only. Either restrict Chrome under Family Safety App limits, or install Focus AI with Parent Passcode Lock inside Chrome.

Does Focus AI work on Microsoft Edge on Windows 11?

Yes. Microsoft Edge supports Chrome Web Store extensions natively, so Focus AI runs on Edge with full Always-On Site Blocker, AI sessions, and Passcode Lock support.

More ways to block YouTube & Windows guides