How to block websites on a Mac or MacBook
The quickest built-in way to block a website on a Mac is Screen Time. Open System Settings > Screen Time > Content & Privacy > App Store, Media, Web, & Games, choose Limit Adult Websites, click Customize, and add the site to the Restricted list. That blocks the site in Safari all the time. For a daily allowance use App Limits, and to block sites in every browser or only during work hours, use the hosts file or a dedicated blocker.
The steps are the same on a MacBook Air, MacBook Pro, iMac, or Mac mini. What changes them is the macOS version. This guide follows macOS Sonoma 14, Sequoia 15, and Tahoe 26, and notes where macOS 27 differs.
Pick a method by when the site should be blocked
"Block a website" can mean three different rules:
- Always blocked. The site never loads. Use Screen Time's restricted list or the hosts file.
- Allowed for a while each day. You get 30 minutes, then it stops. Use Screen Time App Limits.
- Blocked during set hours. No YouTube from 9:00 to 17:30 on weekdays, and it comes back in the evening. Use a scheduled blocker.
Then decide which browsers the block has to cover. Apple documents Screen Time's website list for Safari. An extension covers only the browser it is installed in. The hosts file and system-level blockers work below the browser, so they apply to Safari, Chrome, Firefox, Arc, and the rest.
No self-imposed blocker can stop a determined Mac administrator. The useful question is whether a method adds enough friction to stop the reflex without getting in the way of real work.
Method 1: Block specific websites with Screen Time
Screen Time is free and already on your Mac. Apple keeps the website list in Content & Privacy, not in Safari's own settings.
- Open System Settings and click Screen Time in the sidebar. Turn Screen Time on if macOS asks.
- Click Content & Privacy and turn it on.
- Click App Store, Media, Web, & Games.
- Next to Safari, choose Limit Adult Websites, then click Customize.
- Click the add button below the Restricted list, enter the website URL, and click Done. Repeat for each site.
- Open each site in Safari to confirm it no longer loads.
On macOS 14 Sonoma, that pane is called Store, Web, Siri & Game Center Content, and the menu is Web Content instead of Safari.
Add the main domain first. If a related address still loads, such as youtu.be for YouTube or old.reddit.com for Reddit, add it as well.
On macOS 27, Apple's overview page labels the button Content & Privacy Restrictions. The Safari website list is still documented under App Store, Media, Web, & Games. Apple covers the options in its guide to App Store, Media, Web, & Games settings.
Block everything except a few sites
The same Safari setting has a stricter mode. Choose Allowed Websites Only, click Customize, and keep only the sites you need on the list. Every other website is blocked in Safari. This suits a study account or a child's account better than a work Mac, where you open new sites all day.
The catch with Screen Time
If you set the Screen Time passcode yourself, the block is a few clicks from gone. It holds up best when someone else knows the passcode. Because Apple documents the list for Safari, test Chrome and Firefox separately. If a site you restricted still opens, read why Screen Time is not blocking websites.
Method 2: Set a daily limit with App Limits
App Limits give you an allowance instead of a block. The site works until you have used up the time, then it stops for the rest of the day.
- Open System Settings > Screen Time > App Limits and turn it on.
- Click Add Limit.
- Expand Websites at the bottom of the list. Select a site you have visited, or add its URL.
- In the Time field, choose Every Day and enter an amount, or choose Custom to set a different amount for each day.
- Select Block at end of limit so the site is blocked when the time runs out, then click Done.
These steps follow Apple's App Limits guide for macOS Tahoe 26, and Sequoia 15 uses the same steps. On macOS 27, Apple's guide replaces App Limits with Schedules and Time Allowances, which are set by category such as Social Media or Entertainment. As of October 2026, that guide does not describe a limit for a single website, so check what your version offers.
An allowance answers "how much" but not "when." Twenty minutes of X can be spent at 9:05 on a Monday.
Method 3: Edit the hosts file in Terminal
The hosts file at /etc/hosts maps hostnames to addresses before your Mac asks a DNS server. Point a site at 0.0.0.0 and it fails to load in browsers that use the system's DNS.
- Open Terminal and run
sudo nano /etc/hosts. Enter your Mac password. - Add one line per hostname at the end of the file:
0.0.0.0 youtube.com 0.0.0.0 www.youtube.com - Save with Control-O and Return, then exit with Control-X.
- Clear the DNS cache:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
Each hostname needs its own line, and there are no wildcards. Blocking youtube.com does not block www.youtube.com or m.youtube.com.
The hosts file is free and covers most browsers, but it has no schedule unless you write one with launchd. Undoing it is one edit. Browsers that use their own secure DNS (DNS over HTTPS) can skip the file entirely. The full walkthrough, including why it sometimes seems to stop working, is in how to block websites with Terminal and the hosts file.
Method 4: Use a browser extension
A blocking extension works inside one browser. Many offer custom lists, timers, schedules, or a blocked-page message, and installing one takes a minute.
The limits come from the same place:
- It only covers the browser where you installed it. Opening a second browser gets around it.
- You can turn it off in the browser's extension settings in a few seconds.
- It may not run in private windows. Apple says Safari on macOS Sonoma and later turns off extensions that need website access in private windows by default, per its Safari extensions guide.
- It needs permission to read and change the sites you visit, so check who makes it.
If you use only one browser and want blocking inside it, an extension is a reasonable choice. If you tend to switch browsers when a block gets in the way, read about the website blocker without an extension approach.
If you use Chrome on a Mac
Chrome needs its own test. Apple documents Screen Time's website list for Safari, and Chrome has a Secure DNS setting that can bypass the hosts file. A Chrome extension works only in Chrome, and only while it is turned on. A system-level blocker avoids both problems. Step-by-step options are in how to block websites on Mac Chrome.
Method 5: Block websites on a recurring schedule
A scheduled blocker fits rule 3: "no X, YouTube, or Reddit during my workday." You set the days, the hours, and the sites once, and the block starts on its own every week.
Cactus for Mac is built for this. You set one schedule: a time range, the weekdays it runs, and one list of sites. During those hours the sites are blocked in every browser on the Mac. Outside them, they load normally.
- Download Cactus, move it to your Applications folder, and allow it to run in the background when System Settings asks.
- Choose the days and drag the time block, for example weekdays from 09:00 to 17:30. Overnight ranges such as 22:00 to 06:00 also work.
- Add the sites, such as
youtube.com,x.com, andreddit.com. - Click Turn On Cactus. If the window has already started, blocking begins right away.
A background helper writes the blocked names to /etc/hosts and adds packet filter (pf) firewall rules for the sites' addresses, so no browser extension is involved. For each site it blocks the domain and its www. version. youtube.com also covers m.youtube.com, and x.com also covers twitter.com. Other hostnames, such as youtu.be or old.reddit.com, need to be added separately. Cactus blocks whole sites, not paths, so entering youtube.com/shorts blocks all of youtube.com.
Once a block has started, Cactus has no button to end it early. Edits you make during a block apply from the next one. A Mac administrator can still remove Cactus. Browsers with their own secure DNS, iCloud Private Relay in Safari, proxies, and some VPNs can affect blocking, so test with your usual setup. The details are on how Cactus blocks websites.
What Cactus does not do:
- It has one schedule. There are no different hours per day and no separate site lists.
- It blocks websites, not apps.
- Every block has an end. The longest window is 23 hours 45 minutes, so for a site you never want to see, Screen Time or the hosts file fits better.
- It sends no notifications. The menu bar shows whether blocking is on and when access returns, while the app is open.
Cactus runs on macOS 14 or later, on Apple silicon and Intel. It costs $19.99 once, with a 7-day free trial that starts when you turn on your first schedule. No account or card is needed.
If you need app blocking or more than one schedule, Cold Turkey and Freedom offer both. SelfControl is free. The best website blockers for Mac comparison covers the tradeoffs, and blocking websites on a schedule compares every scheduling option, including Screen Time Downtime.
Compare the ways to block websites on Mac
| Method | Browsers covered | Timing | How easy to undo | Cost |
|---|---|---|---|---|
| Screen Time restricted list | Safari, as Apple documents it | Always on | A few clicks if you know the passcode | Free |
| Screen Time App Limits | Test each browser | Daily allowance | A few clicks if you know the passcode | Free |
| Hosts file | Most browsers, unless one uses its own secure DNS | Always on | One Terminal edit | Free |
| Browser extension | One browser | Depends on the extension | Turn off in browser settings | Free or paid |
| Cactus | Every browser on the Mac | One recurring schedule | No early end in the app; an admin can remove it | $19.99 once |
Test the block before you rely on it
- Open each blocked domain and its
www.version. - Try related addresses: mobile versions, short links, and old interfaces such as
old.reddit.com. - Repeat in every browser you use, including a private window.
- If you use iCloud Private Relay, a VPN, or a browser with secure DNS turned on, test with those on.
- For a schedule, open a blocked site just after the start time, and check that access returns at the end time.
- Restart the Mac once and test again.
A block is only useful if its real behavior matches the rule you meant to set.
Which method should you use?
Use Screen Time if you only use Safari and want a site gone for good, ideally with someone else holding the passcode. Use App Limits if the amount of time matters more than the hour. Use the hosts file if you are comfortable in Terminal and want a free, permanent block across browsers. Use an extension if you live in one browser. Use a scheduled blocker such as Cactus when the rule is about specific recurring hours and you want it to start without a daily decision. Safari users can compare all three Safari routes in the Safari website blocker guide.
