AppBlock Blog Productivity How to Block Websites on a Mac
Quick answer

How to block websites on a Mac

The fastest way to block websites on a Mac is Screen Time, the free tool already built into System Settings. For a backup that works in every browser, edit the hosts file in Terminal. And for blocking that holds across all your apps and can’t be undone in a weak moment, a focus app like AppBlock does the work your willpower keeps skipping.

There’s no single right way to block websites on macOS. The best choice depends on whether you’re locking things down for a kid, killing a personal time sink, or protecting deep-work hours. Below are three methods worth knowing, from the built-in defaults to the option that actually sticks.

Cutting Screen Time Actually Helps

A randomized controlled trial had adults cut recreational screen time to under three hours a week. After just two weeks, their self-reported well-being and mood improved significantly versus the control group.

Method 1 – Screen Time, the Blocker Already on Your Mac

Most people never realize their Mac ships with a website blocker. Screen Time has lived in macOS since Catalina (2019), and it’s the easiest place to start, especially for parents and anyone who browses mostly in Safari.

Here’s how to block websites on a Mac with Screen Time:

  • Open the Apple menu and choose System Settings.
  • Click Screen Time in the sidebar, then turn it on if it isn’t already.
  • Select Content & Privacy and switch it on.
  • Click Content Restrictions, then find the Web Content section.
  • Choose Limit Adult Websites to auto-block Apple’s database of explicit sites.
  • Click Customize, then use the + button under Restricted to add any specific URL.

One step makes the difference between a real block and a speed bump. Back on the main Screen Time page, click Lock Screen Time Settings and set a Screen Time passcode that’s different from your login password. Without it, anyone who knows the Mac’s password switches the whole thing off in seconds.

Best for: parental controls, adult content, quick limits in Safari. 

Weak spots: it leans on Safari and doesn’t reliably cover Chrome, Firefox, or Edge, and a determined user can usually get around it.

Why Even Bother

Research from Gloria Mark at UC Irvine found it takes an average of 23 minutes and 15 seconds to fully return to a task after a single interruption. One “quick” detour to a feed costs far more than the few seconds it feels like.

Method 2 – The Hosts File Trick for People Who Live in Terminal

Deeper in the system sits the hosts file, which decides where web addresses point. Send a distracting domain into a dead end here and it’s blocked in every browser at once. This method is system-wide and free, but it belongs to people comfortable in Terminal, since a wrong move can knock out internet access. Back up the file first.

  1. Open Terminal from Applications › Utilities.
  2. Make a backup with sudo /bin/cp /etc/hosts /etc/hosts-original, then press Return and enter your admin password (the cursor won’t move as you type – that’s normal).
  3. Open the file with sudo nano /etc/hosts.
  4. On a new line at the bottom, point the site at your own machine: 127.0.0.1 www.facebook.com. Add the plain version too on its own line – 127.0.0.1 facebook.com – since one URL doesn’t cover the other.
  5. Save with Control + O, press Return, then exit with Control + X.
  6. Clear the DNS cache so the change takes hold: sudo killall -HUP mDNSResponder.

Best for: advanced users who want one permanent, browser-wide block. 

Weak spots: subdomains and mobile versions (starting with m.) each need their own line, there’s no scheduling, and undoing it is just a matter of deleting a line.

The Window Keeps Shrinking

Mark’s later research shows the average person now spends just 47 seconds on a single screen before switching attention, down from about 2.5 minutes two decades ago. Static blocks help, but attention slips faster than any manual list can keep up with.

Method 3 – AppBlock, a Block That Won’t Negotiate

The two methods above share one flaw. They protect you right up until you decide to undo them, which is usually the exact moment you should be protected most.

That’s the gap a system-wide app like AppBlock closes. Instead of living in one browser or one settings panel, it works across the apps and browsers you actually use, so the rule holds whether you’re in Safari, Chrome, or somewhere else.

What makes it stick:

  • Block in a few clicks. Add any site and the block goes live immediately – no Terminal, no backups to babysit.
  • Block by keyword. Catch a whole category of sites at once instead of chasing one URL at a time.
  • Strict Mode. Lock your settings so you can’t loosen the rules mid-session. Future-you doesn’t get a vote until the timer runs out.
  • Allowlist. Flip the logic – pick the few sites you need for work and let AppBlock block everything else.
  • Schedules. Set focus hours once – school time, deep-work mornings, the hours before bed – and let them run on their own.

AppBlock runs on macOS 11.0 and later, and the core is free.

Best for: anyone breaking a real habit, protecting work hours, or setting a block a kid can’t quietly dismantle.

A Quick Word on Extensions and Router Settings

Two other routes come up often, and both have a ceiling.

  • Browser extensions like BlockSite are easy to install but only guard the browser they’re in. Open a different browser and the wall disappears, and many free versions cap how many sites you can block.
  • Router-level blocking covers every device on the network, which suits a household rule but can’t block a site for you and not your partner. It also does nothing once a laptop hops onto coffee-shop Wi-Fi.

Both can play a supporting role. Neither holds up as the main line of defense for daily focus.

FAQ

How do I block a website on a Mac for free?

Use Screen Time, built into macOS at no cost. Open System Settings › Screen Time › Content & Privacy › Content Restrictions, choose Limit Adult Websites under Web Content, then click Customize to add specific URLs to the Restricted list.

Can I block websites in Chrome on a Mac, not just Safari?

Yes, but not with Screen Time alone, which is most reliable in Safari. To block websites on a Mac across Chrome, Firefox, and other browsers, edit the hosts file in Terminal or use a system-wide app like AppBlock.

How do I stop myself from unblocking a site?

Lock it down. In Screen Time, set a Screen Time passcode different from your login password. In AppBlock, turn on Strict Mode so the block can’t be edited or canceled until the session ends.

Will blocking websites slow down my Mac?

No. None of these methods put any meaningful load on your machine – they simply stop certain addresses from loading.

Sources

  1. UCLA Health. (2026, March 13). Considering a digital detox? Why it’s a good idea and what to know. Retrieved June 1, 2026, from https://www.uclahealth.org/news/article/considering-digital-detox-why-its-good-idea-and-what-know
  2. University of California, Irvine – Department of Informatics. (n.d.). Forbes: Brain-based tips for sharpening your focus (Gloria Mark cited). Retrieved June 1, 2026, from https://www.informatics.uci.edu/forbes-brain-based-tips-for-sharpening-your-focus-gloria-mark-cited/
  3. University of California, Irvine – Department of Informatics. (2023, January 26). Regaining focus in a world of digital distractions. Retrieved June 1, 2026, from https://www.informatics.uci.edu/?p=7800

Gain back control over your screen, empower your life with AppBlock.

Try for free
We use cookies!
We use cookies for the best website functionality, which we process according to our privacy policy. More information about cookies can be found here.