Skip to content

Block Websites in Safari browser on Mac

Do you want to block websites from accessing in the Safari browser? Learn how to block specific websites on the browser.

The web browser gives unrestricted access to all websites by default. However, you can configure the Settings to block websites using their web address URL.

To block a website in the Safari app, add the address to the Content Restriction page. These restrictions will also apply to all the web browsers installed on the machine.

info icon
Note: Blocking the site URL using the system-wide settings will also block its access to other web browsers installed on the machine.

In this guide, we have shared the steps to block the website from accessing in the Safari browser.

Block a Site using System Settings

The Safari browser does not have a built-in site-blocking system in place. However, we have content restriction settings on the Mac system that can easily block the sites from accessing the Safari browser. You can follow these steps:

  1. Click on the Apple apple logo on the menubar.
  2. Select the System Settings menu.
    Apple Menubar with System Settings highlightedIt will open the system settings window.
  3. Switch to the Screen Time tab and select the Content & Privacy option to open.
    Screen Time setting with Content and Privacy on Mac
  4. Toggle to turn on the Content & Privacy setting and select Content Restrictions within that page.
    It will open a new Content Restriction settings page.
  5. Switch the drop-down to Limit Adult Websites under the Access to Web Content option.
    Limit Adult Website on Mac computer
  6. Click the Customize button and add the website URL under the Restricted field.
    Web Content Restriction URL on Mac computer
  7. Hit on Done to save the changes.

Now try accessing the website URL you’ve added to the Restricted list; it will be blocked on the Safari browser.

Access Restricted for Site on Safari browser

You can notice that Safari is blocking the YouTube website and mentions that it isn’t on the approved list in Screen Time. Similarly, you can also add several URLs to block access.

Block the Sites Access with Hosts File

info icon
Caution: Editing the host’s file is highly risky; minor mistakes or wrong entries can block internet access for the entire system. Please proceed with caution and have a backup before editing the file.

The Hosts file is a system file; hence, to edit the Hosts file, your user account must have administrative permissions. Check the Users & Group page on the System Settings window to verify your permission level.

Here are the steps to block the website on Mac using the Host file:

  1. Open the Terminal window on Mac.
    It’s under the Applications folder.
  2. Enter the command: sudo nano /etc/hosts and keypress the Enter button.
    Editing Hosts file in Mac computer
  3. Enter the System Password you use for login and hit the enter button again.
    It will open the ‘hosts’ file in the terminal with an editing option.
  4. Keypress the down button to reach the end of the file.
  5. Add the following code; ensure to add a Tab space between the last digit and the site URL:
    127.0.0.1     youtube.com
  6. Now, keypress Ctrl + X button to exit the editor.
  7. Keypress Y to save the changes, and then Enter to exit the editor.
    Editing the System Hosts file is completed on the Mac
  8. Restart the system to make the changes active.

That’s it; after restarting the system, the website URL entered in the host’s file with the local host IP address will be blocked from internet access.

You cannot open the website on Safari or any other web browser installed on the system. It is a hard setup to block the website URL on the system.

Bottom Line

We can easily block the website URL on the Safari browser using the System settings’ Content Restrictions. It will block the site completely and not allow access to the Safari browser.

Many Safari browser extensions, like 1Focus, Unscreen, 1Blocker, etc., can block the site under the extensions setting.

A similar feature is also available on iPhone and iPad to block websites on the Safari browser. You can easily configure all the content-blocking settings per need.

Lastly, if you've any thoughts or feedback, then feel free to drop in below comment box. You can also report the outdated information.

Please share the article if you find it helpful:

Disclosure: This page may contain affiliate links, which means we may receive compensation for your purchases; of course at no extra cost to you (indeed, you may get special discounts).
Kushal Azza

Kushal Azza

Kushal Azza is a Google Certified IT Professional, Digital Content Creator, and Go-To Digital Marketer with Engineering Degree. He has over a decade of experience solving tech problems, troubleshooting, and innovating digital solutions. Follow him on Twitter and LinkedIn.

Leave a thought or feedback

Please leave a descriptive comment or feedback with your real name. Our human moderator vets every comment, and it may take 24 to 48 hours to get published or rejected.

Your email address will not be published, and we will never spam your inbox. Required fields are marked *