How to block on Windows

How to block apps and websites on Windows 11

How to Block Apps and Websites on Windows 11 (Free, Built-In Methods)

Quick answer

On Windows 11 you have three free options. Microsoft Family Safety blocks apps and filters websites on a child's Microsoft account. The hosts file blocks websites for everyone on the PC. The firewall cuts an app off from the internet. Each one covers part of the problem, so most families combine Family Safety for kids' accounts with the hosts file for the sites that matter most.

Phones get most of the attention, but plenty of lost evenings happen on a laptop. YouTube in one tab, Discord in the corner, and homework somewhere underneath.

Sunnah Lock for Windows is on the way. Until it's here, this is how to block apps and websites on Windows 11 with what's already built in, and exactly where each method leaks.

Option 1: Microsoft Family Safety (best for kids' accounts)

If your child signs in to the PC with their own Microsoft account, Family Safety is the strongest free tool you've got. It does three separate jobs.

Block an app completely

  1. Sign in to your Microsoft account at account.microsoft.com.
  2. Select the tile of the family member whose apps you want to block.
  3. Choose Windows as the place you want to block it.
  4. Open the Apps, features, and games tab to see their installed apps.
  5. Select the more icon next to the app, then Block app.

Microsoft notes that "only Family organizers can block or unblock apps."1 So this works for a parent managing a child. It doesn't help an adult who wants to block something on their own account.

Set a daily time limit on an app or game

  1. Open the Family Safety app, or go to account.microsoft.com/family.
  2. Select the family member and the platform.
  3. Go to Set time limits, then Apps, features, and games.
  4. Turn on App and game limits.
  5. Pick the app and set how much time is allowed each day, and when.

One big catch, straight from Microsoft: "Time limits do not work on websites."2 A limit on a game doesn't touch the same game's website.

Filter websites

  1. Open the Microsoft Family Safety app and select your family member.
  2. Select Content filters.
  3. Add the sites you want to block, or turn on Only use allowed websites for a strict allow-list.

Here's the leak: "Microsoft Family Safety's web and search filters only work in the supported browsers," and your child has to be signed in to their Microsoft account for them to apply. Microsoft handles this by blocking unsupported browsers "so that filtering cannot be bypassed."3 That's sensible, but it means the whole setup depends on the child's account staying signed in and managed.

Option 2: The hosts file (blocks a website for everyone on the PC)

The hosts file is an old Windows feature that tells the computer where websites live. Point a site at 0.0.0.0 and it simply won't load. It doesn't need a Microsoft account, and it applies to every user on the computer.

  1. Search the Start menu for Notepad, right-click it and choose Run as administrator.
  2. Open C:\Windows\System32\drivers\etc\hosts (switch the file type to All files to see it).
  3. At the bottom, add a line for each site, with and without www. For example: 0.0.0.0 youtube.com and 0.0.0.0 www.youtube.com.
  4. Save, then restart your browser.

Where it leaks: anyone with administrator rights can open the file and delete your lines. Some browsers use their own secure DNS setting, which can skip the hosts file entirely. And it only blocks websites, not apps installed on the PC.

Option 3: Windows Firewall (cuts an app off from the internet)

If the problem is an installed app that needs the internet, like a game launcher or a chat app, you can stop it connecting at all. Windows Firewall allows outbound traffic by default "unless it matches a rule that prohibits the traffic,"4 so you add that rule.

  1. Press Start, type wf.msc and open Windows Defender Firewall with Advanced Security.
  2. Select Outbound Rules, then New Rule.
  3. Choose Program and browse to the app's .exe file.
  4. Choose Block the connection, tick all profiles, name the rule and finish.

Where it leaks: it needs administrator rights to set up and to undo. The app just fails to connect with no explanation. And the same service in a web browser isn't affected at all, so pair it with the hosts file.

Which one should you use?

Sunnah Lock for Windows

We're building Sunnah Lock for Windows so the same blocks you set on your phone can hold on your PC too. It isn't out yet. Join the waitlist and you'll hear the day it launches.

Questions people ask

How do I block an app on Windows 11 for free?

Use Microsoft Family Safety. Sign in at account.microsoft.com, pick the family member, choose Windows, open the Apps, features, and games tab, then use the more menu next to the app and select Block app. Only a family organizer can do this, and it applies to a child's Microsoft account.

How do I block a website on Windows 11?

Microsoft Family Safety can block websites for a family member, but its filters only work in supported browsers while they're signed in to their Microsoft account, and unsupported browsers get blocked. Without an account, you can edit the hosts file to point a site to 0.0.0.0, which needs administrator rights.

Can I block websites on Windows without Microsoft Family Safety?

Yes, with the hosts file at C:\Windows\System32\drivers\etc\hosts. Open it in Notepad as administrator and add lines like 0.0.0.0 youtube.com and 0.0.0.0 www.youtube.com. Anyone with admin rights can remove them, and browsers using their own secure DNS may ignore the file.

Does Family Safety time limit work on websites?

No. Microsoft's own support page says time limits do not work on websites. App and game limits cover apps, and website blocking is a separate setting.

Is there a Sunnah Lock for Windows?

It's coming. Sunnah Lock is on Android and iPhone now, and the Windows version is in development. You can join the waitlist at sunnahlock.com to hear the day it launches.

Can I block an app from using the internet on Windows?

Yes. Windows Defender Firewall can block a program's internet access with an outbound rule. It needs administrator rights, and it doesn't stop the same service in a web browser.

Sunnah Lock for Windows is coming

Until then, Sunnah Lock already guards the phone: apps, websites and keywords on Android with Lockdown Mode, and apps, websites and whole categories on iPhone, enforced by iOS itself.

Block something else

Sources

  1. Block or unblock apps with Microsoft Family Safety Microsoft Support
  2. Set app and game limits Microsoft Support
  3. Filter websites and searches using Microsoft Family Safety Microsoft Support
  4. Windows Firewall rules Microsoft Learn