How to Block Facebook on a Computer, Phone and Router
The hosts file, browser policies, Screen Time, Family Link, routers and website blockers · Updated
You can block Facebook on a Windows PC with the hosts file, a Chrome or Edge policy, a browser extension or a website blocker, on a Mac and iPhone with Screen Time, on Android with Digital Wellbeing or Family Link, and on every device at home with your router. The fastest free method on a computer is the hosts file: add 0.0.0.0 facebook.com, 0.0.0.0 www.facebook.com and 0.0.0.0 m.facebook.com and the site stops loading in every browser. On a phone, the Facebook app needs its own block, because blocking the website does not stop the app.

Key takeaways
- Hosts file: blocking only facebook.com is not enough, add the www, m and web versions too.
- Chrome and Edge policy: one facebook.com entry blocks every Facebook subdomain in that browser.
- Phones: the website and the app are blocked separately, with Screen Time on iPhone and Family Link or Digital Wellbeing on Android.
- Router: one rule covers every device on your home network, but not a phone on mobile data.
- Unblocking: to remove a built-in block, reverse the same step.
Methods compared
Only a website blocker set so its blocks cannot be edited or removed is difficult to remove.
| Method | Devices | Blocks the app | Cost | Difficulty to bypass |
|---|---|---|---|---|
| Hosts file | One computer | No | Free | Easy (edit the file) |
| Chrome or Edge policy | One browser | No | Free | Easy (delete the registry value) |
| Browser extension | One browser | No | Free or paid | Easy (remove in one click) |
| Website blocker | Computer, some also phones | Some | Free or paid | Difficult |
| Screen Time (Mac, iPhone) | Apple devices | Yes on iPhone | Free | Medium (needs the Screen Time passcode) |
| Digital Wellbeing or Family Link (Android) | One phone | Yes | Free | Easy for yourself, medium for a child |
| Router or DNS filter | Every device on the network | Yes, on that network | Free | Medium (needs the router password) |
1. Block Facebook with the hosts file (Windows)
The hosts file stops a domain from loading in every browser on the PC. Facebook uses several domain names, so list each one.
- 1.Type Notepad in the Start menu, right click it and select Run as administrator.
- 2.Select File > Open, go to
C:\Windows\System32\drivers\etc, change the file type to All Files and openhosts. - 3.Add these lines at the bottom:
0.0.0.0 facebook.com 0.0.0.0 www.facebook.com 0.0.0.0 m.facebook.com 0.0.0.0 web.facebook.com 0.0.0.0 mbasic.facebook.com 0.0.0.0 touch.facebook.com 0.0.0.0 fb.com 0.0.0.0 www.fb.com
- 4.To block Messenger in the browser as well, add
0.0.0.0 messenger.comand0.0.0.0 www.messenger.com. - 5.Save the file, open Command Prompt and run
ipconfig /flushdns. Close and reopen your browser.
On a Mac, the same lines go in /etc/hosts, which you edit in Terminal with sudo nano /etc/hosts.
Limits: it only blocks the exact names listed, and anyone with administrator access can edit it back.
2. Block Facebook in Chrome or Edge with the URLBlocklist policy
Chrome and Edge read a URLBlocklist policy from the Windows registry. An entry of facebook.com blocks facebook.com and every subdomain, including www and m.
- 1.Press Windows + R, type
regeditand press Enter. - 2.For Chrome, create the key
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\URLBlocklist. For Edge, createHKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\URLBlocklist. - 3.Inside it, create a String Value named
1with the valuefacebook.com. Add2withfb.comand3withmessenger.comif you want those blocked too. - 4.Restart the browser and open
chrome://policyoredge://policyto check the list is active.
Full steps, including Group Policy, are in how to block websites on Chrome.
Limits: each browser needs its own list, Firefox ignores it, and an administrator can delete the values.
3. Use a browser extension
Extensions such as BlockSite and LeechBlock NG block facebook.com in one browser.
- 1.Install the extension from the Chrome Web Store, Edge Add-ons or Firefox Add-ons.
- 2.Add
facebook.comto its block list. - 3.Turn on Allow in Incognito in Chrome, Allow in InPrivate in Edge or Run in Private Windows in Firefox in the extension's settings.
Limits: it only covers the browser it is installed in, and it can be removed from the extensions page in one click.
4. Use a website blocker
If you want to block Facebook with strong enforcement, the best alternative is a hard to bypass blocker that cannot be removed or edited easily, such as Ascension or Cold Turkey Blocker.
Price: 15-day free trial, then $12.99/month or $50 one-time.
- 1.Install Ascension and add its extension to your browser.
- 2.Add
facebook.com, or turn on the premade social media list. To block only one part of Facebook, add a section such asfacebook.com/reels. - 3.Choose Always blocked, a Scheduled block, a daily Time limit or an Entry delay.
- 4.Set the block so it cannot be edited or removed.
Limits: Windows only (iOS and Mac in development).
5. Block Facebook on a Mac with Screen Time
- 1.Open Apple menu > System Settings > Screen Time.
- 2.Click Content & Privacy and turn it on, then click App Store, Media, Web, & Games.
- 3.Next to Safari, choose Limit Adult Websites, then click Customize.
- 4.Under Restricted, click the add button, enter
facebook.comand click Done. - 5.Set a Screen Time passcode so the setting cannot be changed without it.
These menu names are from macOS Tahoe 26. Ascension is in development for Mac: join the Mac waitlist.
Limits: Apple documents the filter for Safari, and it also filters a long list of adult websites you cannot turn off without removing the restriction.
6. Block Facebook on iPhone and iPad (website and app)
Screen Time blocks the Facebook website in Safari and limits the Facebook app separately.
Block the website (iOS 26 and earlier)
- 1.Open Settings > Screen Time > Content & Privacy Restrictions and turn it on.
- 2.Tap App Store, Media, Web, & Games, then Web Content.
- 3.Select Limit Adult Websites, tap Add Website under Never Allow, and enter
facebook.com.
Block the app (iOS 26 and earlier)
- 1.Open Settings > Screen Time > App Limits and tap Add Limit.
- 2.Tap the social category to see its apps, select Facebook, and tap Next.
- 3.Set the time allowed to 1 minute and save.
On iOS 27, Screen Time for your own iPhone uses Time Allowances by category under Settings > Screen Time > Time Allowances. Set a low allowance for the Social Media category. Apple states that if an app declares its website, the allowance applies to both.
For a child on iOS 27, open Settings > Family, tap the child's name, tap Apps & Websites, select Facebook, and tap Block App or Block Website. Set a Screen Time passcode with Lock Screen Time Settings so the limits cannot be changed without it.
Limits: you can delete the app and use another browser that is not filtered, and anyone who knows the passcode can remove the limits.
7. Block Facebook on Android
For yourself, with Digital Wellbeing
- 1.Open Settings > Digital Wellbeing > App timers.
- 2.Tap Set timer next to Facebook, choose the shortest time and tap OK.
When the time runs out, the app closes and its icon dims until midnight.
For a child, with Family Link
- 1.Open the Family Link app and select your child.
- 2.Tap Controls > App limits, select Facebook and tap Block.
- 3.To block the website in Chrome, tap Controls > Google Chrome and Web, then Approved sites and Blocked sites, then Add a website, and enter
www.facebook.com, or the domainfacebookto cover every version.
Limits: Digital Wellbeing timers can be deleted in Settings by the phone's owner, and neither method blocks Facebook in browsers other than Chrome.
8. Block Facebook on your router or with a DNS filter
A router rule blocks Facebook on every phone, computer and tablet on your Wi-Fi, including the app.
- 1.Open your router's admin page, usually
192.168.1.1or192.168.0.1, and sign in. - 2.Find the website filter, often under Parental controls, Access control or Security. The name differs by brand.
- 3.Add
facebook.comandfb.com, andmessenger.comif you want Messenger blocked. Save.
If your router has no website filter, a DNS service such as NextDNS or CleanBrowsing lets you add facebook.com to a block list or block a social media category, then you enter its addresses in the router's DNS settings.
Limits: a phone on mobile data or a VPN is not covered, and anyone with the router password can remove the rule.
How to unblock Facebook
Reverse the step you used to block it:
- 1.Hosts file: delete the Facebook lines, or add
#at the start of each line, save, and runipconfig /flushdns. - 2.Chrome or Edge policy: delete the facebook.com value under URLBlocklist and restart the browser.
- 3.Browser extension: remove facebook.com from its block list, or turn the extension off.
- 4.Mac and iPhone: remove facebook.com from the Restricted or Never Allow list, and delete the app limit or allowance.
- 5.Android: delete the app timer in Digital Wellbeing, or tap Allow on Facebook in Family Link.
- 6.Router: delete the rule from the website filter.
A website blocker such as Ascension, Cold Turkey or Freedom in Locked Mode keeps Facebook blocked when the block is set so it cannot be edited or removed.
Which method should you use?
If you want to block Facebook on one Windows PC for free, choose the hosts file with every domain above. If you want to block it in Chrome or Edge only, choose the URLBlocklist policy. If you want to block it on an iPhone or Mac, choose Screen Time with a passcode. If you want to block it on Android, choose Digital Wellbeing for yourself or Family Link for a child. If you want to block it on every device at home, choose your router. If you want to block Facebook with strong enforcement, choose a hard to bypass blocker such as Ascension. If you want Facebook blocked on your computer and phone at the same time, choose Freedom.
Frequently asked questions
How do I block Facebook on my computer?
Add 0.0.0.0 facebook.com, 0.0.0.0 www.facebook.com and 0.0.0.0 m.facebook.com to the Windows hosts file and run ipconfig /flushdns. For a block you cannot remove, use a website blocker. More options are in how to block websites on a PC.
How do I block the Facebook website but not the app?
Block the website with the hosts file, a browser policy or Screen Time's website list. These stop facebook.com in browsers and leave the app on your phone untouched.
How do I block Facebook apps?
On iPhone, use Screen Time App Limits or Time Allowances. On Android, use a Digital Wellbeing app timer or Family Link. A router rule stops the app on your home Wi-Fi.
How do I block Facebook on my router?
Sign in to the router's admin page, open its website filter or parental controls, and add facebook.com and fb.com. The block covers every device on the network.
How do I block Facebook only during work hours?
The hosts file and browser policies cannot schedule. Use Screen Time schedules on Apple devices, a browser extension with a schedule, or a website blocker such as Ascension, Cold Turkey or Freedom.
Does blocking facebook.com also block Messenger?
No. Messenger has its own domain, messenger.com, and its own app. Add the domain to your block list and block the Messenger app separately on a phone.
Is blocking Facebook the same as blocking someone on Facebook?
No. Blocking someone or a Page is done inside Facebook: open their profile or Page, select the three dots menu, and choose Block. This article covers blocking the Facebook site and app on your devices.
How do I stop myself from unblocking Facebook?
Use a Screen Time passcode that someone else sets, or a website blocker that can be set so its blocks cannot be edited or removed. See website blockers that can't be uninstalled for blocking more sites at once.
Available on Windows 10 & 11