How to Permanently Block Websites on Safari on Mac

Blocking websites is not a trivial task, and you may require expert help. MacKeeper’s Premium Services can help you set all important configurations and show you how to permanently block websites on Safari on a Mac in the most efficient way.

System Requirements: macOS 10.11 or later

More than 60 Million Downloads

i

AV-TEST certified

i

Notarized by Apple

i

AV-TEST is an independent lab that checks the effectiveness of antivirus apps against real malware samples.

The notarization by Apple is a security measure to check if software is free from malicious components.

Trustpilot is an independent digital platform that hosts insightful and honest consumer reviews.

How to Permanently Block Websites on Safari on Mac
Written By   Aya Masango
Updated: August 26, 2026

Key takeaways

  • Use Screen Time to block websites in Safari on Mac.
  • To create a Safari restriction list, go to System Settings > Screen Time > Content & Privacy > Content Restrictions, select Limit Adult Websites, click Customize, and add websites you want to block.
  • Choose Allowed Websites Only to specify the list of websites that can be opened in Safari.
  • You can modify the host file in Terminal to block the website at the system level.
  • Use third-party tools to block websites in Safari without Screen Time.
  • Use tools like StopAd to block ads, pop-ups, and online trackers.

You can access just about any website on Safari, but there are times when you’d want to restrict some websites for one reason or another. Maybe you share your Mac with your family, or your kids use it for school and entertainment. Maybe you just prefer not to access certain websites. Whatever the reason, Mac allows you to block websites from launching on Safari.

 

There are several ways to ban websites on Safari on your Mac, the obvious being third-party apps. But you can also blacklist websites using Mac’s Screen Time feature, and in Safari through your router. Not sure how that works? We’ve got you covered. This article will show you all the ways to block websites on Safari on your Mac.

A note from our experts: 

 

Sometimes you might need help to solve the issue with your Mac. If blocking websites is one of them, ask our experts to help. Use MacKeeper’s Premium Services, which are available 24/7.

 

How to use MacKeeper’s Premium Services:

  1. Download MacKeeper.
  2. Launch our app and click Premium Services on the left.
  3. Start a chat with an expert to get your issue resolved.
  4. If you don't know how to block websites on Safari, ask our tech expert. Launch Safari and choose Premium Services, click Chat Now.
    Step 1. MacKeeper > Premium Services > Chat now
    Start a chat with one of 150 tech experts. They will give you instructions on how to block sites in Safari.
    Step 2. Start a chat with one of our experts

Let’s have a look at all the ways you can block websites on Safari on your Mac.

How to block websites on Safari on Mac

The easiest way to block websites on Safari on a Mac is to use Screen Time settings. You can restrict access to specific websites on Safari or open only allowed websites. This is also how to block undesirable websites on Google Chrome.

How to block websites in Safari on a Mac using Screen Time

Apple's Screen Time helps you manage and track how you use apps and websites on your Mac. Alongside downtime schedules and app limits, it gives you the cleanest built-in way to shut out unwanted sites, and from our experience it's the method most people should reach for first.

  

To set a list of websites you want to access on Safari:

  1. Open the Apple menu, select System Settings, then click Screen Time in the sidebar.
  2. Turn on App & Website Activity if it isn't already enabled—the rest of the options stay greyed out until you do.
  3. Click Content & Privacy, then switch Content & Privacy on.
  4. Click App Store, Media, Web, & Games. On older macOS versions, this pane is called Content Restrictions.
  5. Open the Access to Web Content menu and choose Allowed Websites Only.
  6. Click Customize, use the plus icon to add every site you want to permit, then click Done. Anything outside that list simply won't load in Safari.
  7. Open System Settings from the Apple menu, then click Screen Time in the sidebar to reach the App Limits, Communication Limits, and Content & Privacy options.
    Step 1. Open System Settings and click Screen Time in the sidebar to begin
    Click Content & Privacy in Screen Time settings, then switch the Content & Privacy toggle on to unlock the web content restrictions for Safari on your Mac.
    Step 2. Click Content & Privacy and switch the Content & Privacy toggle on
    Click App Store, Media, Web, & Games in Content & Privacy, then set Access to Web Content to Allowed Websites Only to limit Safari to your list.
    Step 3. Open App Store, Media, Web, & Games and set Access to Web Content to Allowed Websites Only

And here's how to block individual sites while leaving the rest of the web open:

  1. Go back to System Settings > Screen Time > Content & Privacy > App Store, Media, Web, & Games.
  2. Set Access to Web Content to Limit Adult Websites.
  3. Click Customize to open the allowed and restricted lists.
  4. Under Restricted, click the plus icon, type the full URL, and click Done.
  5. Repeat for every site on your list, then click Done to save.
  6. Set Access to Web Content to Limit Adult Websites, then click Customize to open the Allowed and Restricted lists where you add specific sites.
    Step 1. Choose Limit Adult Websites, then click Customize to open both lists
    Click the plus icon under Restricted, type the full URL of each website you want blocked in Safari, then click Done to save your list.
    Step 2. Click the plus icon under Restricted and enter each website you want blocked

That's it—Safari will now refuse to open the sites you've listed.

A tip from our experts: If you're setting these limits for a child, scroll down in Screen Time and turn on Lock Screen Time Settings to create a four-digit passcode. Without it, the restrictions are two clicks away from being switched off.

How to block websites in Safari on a Mac with Terminal

Terminal is Mac’s interface that allows you to block websites without parental controls. It works by blocking websites from opening on the local IP address. As this is a more technical method, only attempt it if you’re comfortable with using command-line prompts.  

 

To restrict access to the website using Terminal:

  1. Launch Finder on your Mac
  2. Click on Applications, then double-click on the Utilities folder.
  3. Double-click on Terminal to launch it.
  4. Start by backing up the host file. This is an important step, in case anything goes wrong. To back up the host file, type “sudo /bin/cp /etc/hosts /etc/hosts-original” on a new line and press the Return key.
  5. Enter your Mac’s admin password when prompted, then press the Return key again.
  6. Type “sudo nano /etc/hosts”, followed by the Return key.
  7. Using the down arrow key on your Mac, go to a new line and add the URL of the website you want to block, with the local IP address “127.0.0.1” before it, separated by a space. Be sure to add all the versions of the website on a new line, For example, “127.0.0.1 onlyfans.com” and “127.0.0.1 www.onlyfans.com”. Do this for every website you want to block.
  8. When you’re done, press Control-O. Now press the Return key. Your blocked websites are now saved.
  9. To exit Terminal, press Control-X.
  10. Use Terminal to block websites in Safari on a Mac. This method requires manual entry URLs of the website you want to block.

If you’re uncomfortable with using this method, there are more ways to block websites on Safari.  

 

Related reading: How to use Terminal command line on your Mac

How to block websites in Safari on a Mac through router

You can also adjust settings directly on your Wi-Fi router to block websites without touching Screen Time at all. As our team has found, this approach is the most thorough of the lot, since it restricts the site across every device on your network rather than one specific Mac.

 

Here's the process from your Mac:

  1. Find your router's IP address—it's usually printed on a label underneath the device. Alternatively, go to System Settings > Network > Wi-Fi > Details… > TCP/IP, where it appears next to Router.
  2. Type that IP address into Safari's address bar and press Return.
  3. Enter your router's admin name and password when prompted.
  4. Look for a section named Parental Controls, Access Restrictions, or URL Filtering—the wording varies between manufacturers.
  5. Add each website you want to block and save your changes.
  6. Open System Settings, click Network in the sidebar, select Wi-Fi, then click Details next to your active network to view its configuration options.
    Step 1. Go to System Settings > Network > Wi-Fi and click Details next to your network
    Open the TCP/IP tab in your Wi-Fi details, then copy the IP address shown next to Router to sign in to your router's settings page.
    Step 2. Open the TCP/IP tab and copy the address shown next to Router
    Type your router's IP address into Safari's address bar, press Return, then sign in with your router admin name and password to open its settings.
    Step 3. Enter your router's IP address in Safari and sign in with your admin credentials

You're all set. Just remember to repeat this if you ever swap out your router.

How to block websites in Safari on a Mac using third-party website blocker apps

Up until now, we’ve shown you multiple ways to restrict access on a device level. The final way to block websites on your Mac is with the help of third-party apps. Here are three apps we recommend:

1Focus

As the name suggests, 1Focus helps you stay focused on any work or task you’re busy with by eliminating distractions, like websites. This is one of the more popular focus apps. Blocking websites on 1Focus is easy.

1Focus allows you to block websites on the free version. Blocking websites on 1Focus is easy

1Focus allows you to block websites on the free version, but you can do more with in-app purchases. The free version lasts for 14 days, after which you’ll have to pay around $2/month or $10/year, unless you cancel your trial before the trial period is up.

Session

Session allows you to work in 25-minute sessions. What makes it unique is that it has a wellness element to it — the app prompts you to breathe before you start a new session and take a break when you’re done. You can block websites to limit distractions while you work or study. The app is free, but to use the Website Blocker feature, you’ll have to upgrade to the Pro version.

You can block websites to limit distractions while you work or study using Session. The app is free, but to use the Website Blocker feature, you’ll have to upgrade to the Pro version.

If you’re impressed with the free version of the app and are willing to upgrade, you’re looking at paying around $4/month.

Freedom

This focus app helps you limit distractions across all your devices simultaneously, unlike other website blockers which are device-specific. Like other apps, Freedom allows you to create a list of blocked websites. Checking the optional Locked Mode box locks in your sessions by not allowing you to edit your blocklists while you work.

The Freedom app allows you to create a list of blocked websites.

Freedom offers you six free sessions. When you’ve used them up, you’ll have to pay $7/month to continue using the app.

Reasons to block websites on Safari

People come to us with all sorts of motives for restricting a site, and rarely is it just about willpower. Here are the reasons we hear most often:

  • Protecting kids from adult content. Screen Time's restrictions stop age-inappropriate sites from opening on a shared or family Mac, even by accident.
  • Cutting distractions. Social media and news sites eat into study and work hours, and blocking them removes the temptation entirely rather than relying on self-control.
  • Avoiding phishing and scam pages. If you've already run into a fraudulent site, blocking the domain keeps anyone on your Mac from landing there again.
  • Reducing malicious ads and trackers. Sites heavy with pop-ups and third-party trackers can expose your browsing habits, and some serve adware alongside their content.
  • Saving bandwidth. Streaming and video-heavy sites can drag down a shared connection, especially on a busy home network.

Can I permanently block a website in Safari?

Yes, though "permanent" depends on the method you pick. A Screen Time restriction protected by a passcode is the closest thing to permanent on a single Mac, since nobody can lift it without the code. A router-level block is broader still and lasts until you change the setting or replace the router. Terminal edits to the hosts file also persist, but anyone with admin access can undo them in a minute. In our experience, combining a Screen Time passcode with a router rule is the most reliable setup.

Block unwanted websites easily on your Mac

Mac offers multiple ways to block websites in Safari. Most of these are built-in solutions, but you can also blacklist websites through apps found on the App Store and online. Choose the method that is most suitable for you from the options laid out in this article.

 

Read more:  

Use your Mac to the fullest! Sign up and get:
Effective tips on how to fix Mac issues
Reliable advice on how to stay safe online
Mac-world news and updates

Thank you!

You’ll love exploring your Mac with us.

Oops, something went wrong.

Try again or reload a page.

Here’s another sign you need to upgrade your macOS ASAP:

30% off your MacKeeper subscription

Сopy the code now and use it in the MacKeeper checkout after the upgrade.

Copy Code

Please be aware that this code cannot be combined with any other discounts, offers, or promotions.

Contents

Unlocked

Remove unneeded Safari extensions with MacKeeper.

Start now.
PC

MacKeeper - your all-in-one solution for more space and maximum security.

Try Now

Read more

Apple Security Alert
Apple Security Alert
XProtect on Mac
XProtect on Mac
arrow

Run Application

step_1

Click Continue

step_2

Click Install

step_1

Your macOS version is lower than OS 10.11. We’d like to offer you MacKeeper 4 to solve the cleaning, privacy, and security issues of your macOS.