How to block websites on Safari, and keep them blocked
On this page
- How do I block a website on Safari with Screen Time?
- How do I block all websites except a few?
- How do I block websites on Safari at set hours?
- How do I block a website on a Mac for every browser?
- Can I use a Safari content blocker or DNS filter instead?
- Where does this block leak?
- What about Safari on iPhone?
- What is a good setup to start with today?
To block a website on Safari, open System Settings, click Screen Time, then Content & Privacy, then App Store, Media, Web, & Games. Under Safari, choose Limit Adult Websites, click Customize, and add the site to the restricted list. Safari will stop opening it.
That is the easy part. The hard part is that the block only covers Safari, and you can undo it yourself. This guide covers the free methods, where each one leaks, and how to close the gaps.
How do I block a website on Safari with Screen Time?
Use Screen Time’s web restrictions. They are built into macOS and cost nothing.
- Open System Settings and click Screen Time in the sidebar. Scroll down if you do not see it.
- If Screen Time is off, click Turn On or the setup option shown.
- Click Content & Privacy and make sure it is on.
- Click App Store, Media, Web, & Games. On older macOS versions this section is called Store, Web, Siri & Game Center Content.
- Find the Safari row. Choose Limit Adult Websites.
- Click Customize.
- Under the restricted list, click Add (+), type the website address, and click Done.
Apple’s page for this is Change App Store, Media, Web, & Games settings in Screen Time on Mac. Menu wording shifts between macOS versions, so if a label looks different on your Mac, use the search box in System Settings.
Two notes. Add the main address (for example, reddit.com) and check whether the mobile or app subdomains also need adding. And Apple says on its own page that Screen Time can let some adult sites through or block safe ones, so treat the built-in list as a start, not a promise.
How do I block all websites except a few?
Switch the Safari row to Allowed Websites Only. Everything not on your list stops opening.
- Go to System Settings > Screen Time > Content & Privacy > App Store, Media, Web, & Games.
- On the Safari row, choose Allowed Websites Only.
- Click Customize. You will see a default list.
- Remove what you do not want. Click Add (+) to add each site you need, with a title and the URL.
- Click Done.
This is the strictest free option. It suits a work block, where you want email, docs and a few tools and nothing else. It is also annoying the first week, because you will keep hitting a wall on a site you forgot to add. That is fine. Add it once and move on.
How do I block websites on Safari at set hours?
Use Downtime for the schedule, and keep the web list for the permanent blocks.
- Open System Settings > Screen Time > Downtime.
- Turn it on and set the schedule, for example 9 pm to 7 am. You can use the same schedule every day or a different one per day.
- Turn on Block at Downtime if you see it. Apple says that option appears only when a Screen Time passcode is set.
- Choose which apps stay allowed during Downtime.
Downtime blocks apps, not individual websites. If Safari is not on your always-allowed list, Downtime shuts the whole browser. That is a clean way to cut late-night browsing, and it also covers the sites you did not think to list.
How do I block a website on a Mac for every browser?
Edit the hosts file. This works at the system level, so it does not care which browser you use. It is free, and it is a bit technical.
- Open Terminal (Applications > Utilities).
- Type
sudo nano /etc/hostsand press Return. Enter your admin password. - Go to the bottom of the file and add one line per site:
127.0.0.1 www.reddit.com
127.0.0.1 reddit.com
- Press Control+O, then Return to save. Press Control+X to exit.
- Flush the DNS cache with
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. - Quit and reopen your browser.
You need both the bare domain and the www version, and often other subdomains too. The hosts file cannot use wildcards, so it is a poor fit for big sites with many addresses. It also does nothing against apps that connect by other means.
To undo it, delete the lines. That takes ten seconds, which is the problem. Anyone with your admin password, including you on a bad night, can do it.
Can I use a Safari content blocker or DNS filter instead?
Yes, both are free options, and each fits a different job.
Safari content blockers. Open the Mac App Store, search for Safari content blockers or extensions, and install one. Then go to Safari > Settings > Extensions and turn it on. These hide or block elements and sites inside Safari. Check the developer and the permissions first, because an extension that reads every page you visit can see a lot.
DNS filtering. You can point your Mac, or your whole router, at a filtering DNS service. Cloudflare’s 1.1.1.3 and 1.0.0.3 addresses block malware and adult content. To set it on one Mac, go to System Settings > Network, pick your connection, click Details > DNS, and add the addresses. It covers every browser on the Mac. It does not let you block a specific site like YouTube, only the categories the service filters.
Both can be switched off by whoever has the settings open, so the same passcode rule applies.
Where does this block leak?
This is the part most guides skip. Here is where free Safari blocks fail.
Other browsers. Apple describes the web settings under Safari. Several people on Apple’s community forums report that Chrome and Firefox still open restricted sites. We could not find an official Apple statement either way, so test it. Open a blocked site in each browser you have. If it loads, delete that browser or block it with Downtime, or use the hosts file or DNS method that covers the whole Mac.
You know the passcode. If you set the Screen Time passcode yourself, you will type it when the urge hits. Go to System Settings > Screen Time > Lock Screen Time Settings and have someone you trust enter a four-digit code while you look away. Apple’s page is Set, change, or remove a Screen Time passcode on Mac.
You are an admin. Admin accounts can edit the hosts file, change DNS and install other browsers. Create a standard account for daily use and keep the admin password with someone else, or at least somewhere hard to reach. This is slow and fiddly to set up, but it is the real lock on a Mac.
Private browsing and VPNs. Private windows in Safari still follow Screen Time. A VPN or a DNS-over-HTTPS setting inside a browser can sidestep a DNS filter or the hosts file, because the lookup goes somewhere else. If you use either, check that your block still works.
Your phone. Your Mac’s block does nothing for the same site on your iPhone. See how to block websites on iPhone for that side, and turn on Share Across Devices in Screen Time so your Apple devices follow the same rules.
Windows, Android or a work laptop. None of this reaches them.
Closing every gap takes a passcode someone else holds, a standard account, one block per browser and a second block on your phone. That is a lot of upkeep for one habit. We’re building SoberScroll so one account blocks sites, apps and adult sites across your phone and laptop, with Strict mode that survives restarts; join the waitlist.
What about Safari on iPhone?
Safari on iPhone uses the same Screen Time idea with different menus. Go to Settings > Screen Time > Content & Privacy Restrictions > App Store, Media, Web & Games > Web Content, then choose Limit Adult Websites or Only Approved Websites. The full steps and the iPhone-specific loopholes are in how to block websites on iPhone.
If your problem is the apps rather than the websites, how to block apps on iPhone covers App Limits and the passcode trick in more detail.
What is a good setup to start with today?
Here is a setup that takes 15 minutes on a Mac:
- Turn on Screen Time and Content & Privacy.
- Add your worst sites to the restricted list under Limit Adult Websites > Customize. If you need a hard work block, use Allowed Websites Only.
- Open each other browser you have and test one blocked site. Delete any browser that lets it through.
- Set a Screen Time passcode through Lock Screen Time Settings, and have a friend or partner choose the code.
- Switch your daily account to a standard user if you can live with it.
- Repeat the block on your iPhone.
Check it after a week. If you found a workaround, close it that day. A block that leaks is one you will learn to beat.
If your real problem is the feed, not a single website, how to stop doomscrolling is the better place to start.
Common questions
How do I block a website on Safari on a Mac?
Open System Settings, click Screen Time, then Content & Privacy, then App Store, Media, Web, & Games. Under the Safari row, choose Limit Adult Websites and click Customize, then add the site to the restricted list. Safari will refuse to open it after that.
Does the Screen Time block work in Chrome or Firefox on a Mac?
Do not count on it. Apple describes these web settings under Safari, and several people on Apple's forums report that Chrome and Firefox ignore them. Test it yourself in each browser you have installed, and remove or block the ones you do not need.
How do I block every website except a few on Safari?
In the same Screen Time menu, choose Allowed Websites Only, then click Customize and add the sites you want to keep. Everything else is blocked in Safari. This is the strictest built-in option, and it works well for a work-only setup.
Can I block a website on Safari without Screen Time?
Yes. You can edit the hosts file in Terminal, which points a site to a dead address for the whole Mac. You can also install a Safari content blocker from the Mac App Store, or set your DNS to a filtering service. Each one can be undone by anyone with your admin password.
How do I stop myself from removing the block?
Set a Screen Time passcode that someone else chooses, and use a standard (non-admin) account for daily use. If you know the passcode and the admin password, you can undo any free block in a minute. The block is only as strong as who holds the keys.
One blocker for every device
We're building SoberScroll to block Reels, Shorts, apps and adult sites on Android, iPhone, Windows and Mac, with a strict mode that holds. Join the waitlist for the launch price.