How to Block YouTube on Windows 11 (Full Block or Work-Hours Only)
Block YouTube on a Windows PC in every browser, or only during work hours. Hosts file steps, the embed trade-off, and a block you can't just switch off.
Updated October 2026 · 6 min read
Decide what "block YouTube" means for you
YouTube is unusual: it is both the biggest time sink on most PCs and a genuine work tool. Developers watch conference talks, designers learn tools, students follow lectures. Before touching settings, pick one of three outcomes:
- Full block: YouTube is gone from this PC, embeds included.
- Scheduled block: gone during deep-work hours, back in the evening.
- Restricted Mode: still available, but with mature content filtered and comments hidden.
The free Windows tools only really do the first one, badly. A DNS rule can do all three.
Free method: block YouTube in the hosts file
- Run Notepad as administrator and open
C:\Windows\System32\drivers\etc\hosts. - Add
0.0.0.0 youtube.com,0.0.0.0 www.youtube.com,0.0.0.0 m.youtube.comand0.0.0.0 youtu.be. - Save and run
ipconfig /flushdns, then restart your browser.
Video itself streams from googlevideo.com servers with hundreds of random subdomains, which hosts cannot wildcard, so embedded players may still partly work. There is no schedule, and an admin account can revert it instantly. If you use Microsoft Family Safety with a child account, you can add youtube.com to its blocked sites list, but that only applies in Edge.
Block YouTube with NoorI
- Enroll the PC with the free Cloudflare One app using our Windows setup guide.
- In Content Policy, create a rule, open Apps and add YouTube. NoorI's YouTube entry covers
youtube.com,youtu.be,ytimg.comand thegooglevideo.comvideo servers, wildcards included. - Save. YouTube now fails in Chrome, Edge, Firefox, the YouTube PWA and any desktop app that tries to load it.
Blocking apps by name needs Pro; the Free plan is limited to the Basic adult-content preset.
Only block YouTube during work hours
Add a schedule to the same rule, for example Monday to Friday, 09:00 to 17:30 in your timezone. Outside those hours YouTube works normally. The Work Focus Hours and Deep Work Mode templates in Content Policy are a quick starting point. More ideas in blocking distracting websites during work hours.
Or keep it, filtered: YouTube Restricted Mode
If you need tutorials but want mature content gone, add a YouTube Restricted Mode rule instead of a block. NoorI enforces it at the DNS level, so it applies in every browser and cannot be switched off from YouTube's own account menu. It does not reduce the time you spend there, so pair it with a schedule if distraction is the real issue.
Trade-offs and making it stick
- Embeds break everywhere. Docs, course platforms and blog posts with YouTube players will show errors while the block is active. That is the price of a full block.
- Your phone is separate. Blocking YouTube on Windows does nothing for the YouTube app on your phone: enroll that too.
- Remove the escape hatch. Use a standard Windows account so the Cloudflare One app cannot be uninstalled, and turn on Guardian Mode so removing the YouTube rule needs your accountability partner's approval plus a delay of at least 4 hours.
Pro is $9.99/month with a 7-day free trial and covers up to 10 devices. Doing this for a child's PC? See per-child rules.
Frequently asked questions
How do I block YouTube on Windows but not other Google sites?
Block the YouTube app in NoorI rather than a Google category. It targets YouTube domains and its video servers, while Search, Gmail and Docs keep working.
Can I block YouTube only during work hours on my PC?
Yes. Add a schedule to the YouTube rule, for example weekdays 9 to 5. Scheduling is a Pro feature.
Why does YouTube still play after I edited the hosts file?
Video streams from many googlevideo.com subdomains and your browser may have cached lookups. Hosts files cannot use wildcards, so a DNS rule that covers every subdomain is more reliable.