How to block websites on Mac, in Safari and Chrome
To block websites on Mac, add them to the restricted list in Screen Time, install a Chrome extension, or edit the hosts file in Terminal. Each blocks only the sites you name. To allow only the one site you need, lock your Mac to that tab with Focus Berry: everything else is out of reach until the timer ends.
Updated
Can I block everything except the one site I need?
Yes, and for many people that is the real job: not a list of bad sites, but one good one. How to allow only one website on Mac covers Screen Time’s Allowed Websites Only and a one-tab lock that needs no list. The methods below block the sites you name.
How do I block websites on a Mac with Screen Time?
Screen Time is the one website blocker that comes with macOS. It keeps a restricted list of sites, and you can protect it with a passcode.
- Open Screen Time.System SettingsScreen Time
- Open the web content settings.System SettingsScreen TimeContent & PrivacyApp Store, Media, Web, & Games
Older macOS versions
Earlier versions:System SettingsScreen TimeContent & PrivacyStore, Web, Siri & Game Center Content - Select Limit Adult Websites.
- Click Customize.
- Click the Add button below the Restricted list and enter the website’s address.
- Click Done.
- Turn on Lock Screen Time Settings, so you can’t undo the list in a weak moment.System SettingsScreen TimePasscode & Management
If Screen Time is off, turn it on. You may need to scroll down the sidebar to find it.
Apple’s page describes the setting but doesn’t say which browsers it covers, so open a blocked site in the browser you use before you rely on it. It also blocks only sites you list; every site you forgot stays open.
How do I block websites on Mac in Safari?
Safari has no site blocker of its own. Its Websites settings change how a site behaves, such as auto-play and pop-ups, and don’t block it. In Safari, the built-in way to block a website on a Mac or MacBook is the Screen Time list above, and Safari extensions from the App Store add blockers on top of it.
How do I block websites on Mac in Chrome?
Chrome has no setting that blocks a site for you. People add a blocking extension from the Chrome Web Store, which works inside Chrome only, so Safari or Firefox stays open. To cover every browser, block at the system level with Screen Time or the hosts file, or lock the whole Mac to one tab.
How do I block a website on a Mac with Terminal?
The hosts file is the oldest way: you point a website’s name at your own Mac, so it never loads. It edits a system file, so take a copy first.
- Back up the file in Terminal:
sudo cp /etc/hosts /etc/hosts.backup - Open the file:
sudo nano /etc/hosts - Enter your password.
- Go to the end and add a line for each site, such as
127.0.0.1 example.comand127.0.0.1 www.example.com. - Save and close: ⌃O, Return, then ⌃X.
- Clear the cache so it takes effect:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
A typo in that file can break more than the site you meant, and you can undo it in the same file in a minute, so it only holds as long as you let it.
How do I block websites on Mac with Focus Berry?
- Download Focus Berry.
- Open the DMG and drag Focus Berry to Applications.
- Open the one website you need in a tab in Chrome, Safari or Firefox.
- Click Focus Berry in your menu bar.
- Choose a browser tab as the one thing.
- Pick the tab you opened.
- Choose how long the session lasts.
- Choose how hard it is to leave: Easy, Breaks or Typing, or Impossible with Pro.
- Start the session.
The first time, macOS asks whether Focus Berry may control the browser. That prompt is macOS’s own.
You never write a list. Every other tab, window and app steps aside, and every other display goes dark or shows a calm backdrop. Nothing is closed, and when the timer ends your tabs and windows come back. Easy ends with one click; Impossible, in Pro, has no way out until the timer ends.
Is blocking websites on a MacBook different from a Mac?
No. To block websites on MacBook models you use the same Screen Time, Terminal and browser steps as on an iMac or a Mac mini. Focus Berry runs on any of them with macOS 14 or later, and on a MacBook it also darkens an external display.
Which way of blocking websites should I use?
A website blocker for Mac usually works from a list, which is fine when you know the sites that pull you away: Screen Time for the system, an extension for one browser, the hosts file if you like Terminal. If a new site always turns up, lists keep missing it, and one tab is easier to hold than a list is to finish. Weigh the options in the best focus apps for Mac, or compare Focus Berry with the usual blockers.
What if my work needs a few websites?
Pro can lock several tabs at once. Pro is €49 a year or €149 once, with a 6-month money-back guarantee. Locking a single tab is free, at any length. See it in use for studying.
More guides
Your next 45 minutes, on one thing.
Pick it, start the timer, and let Frost keep watch.
Free · macOS 14 or later