Skip to content

How to Block Websites on Safari for Mac

The Safari browser has unrestricted access to all websites by default. However, you can configure the Mac Settings to block websites using their web address URL. You need to add the address in the Content Restriction page to block a website. These restrictions will also apply to all the web browsers installed on the machine.

Block Websites on Safari browser

Apple Safari, as a web browser, does a great job of providing a superior browsing experience with great privacy. It also has great customization and personalization for making browsing user-friendly. We can access any website and URL unless ISP or the government restricts us.

However, it also has the feature to block websites you think are not worthy or time-wasting, like Facebook, YouTube, Twitter, etc. You need to configure the system settings on a Mac computer to block these sites.

Alternatively, you can edit the system hosts file to block the site access completely. You can also use browser extensions to block the sites available in App Store.

Block 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 on Safari browser. You can follow these steps to block a website URL:

  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 Access using Hosts 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 on How to Block Websites on Safari for Mac, 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 using our links; of course at no extra cost to you (indeed, you may get special discounts).
nv-author-image

Kushal Azza

Kushal has a Bachelor of Engineering in Mechanical; however, his passion for technology and gadgets has made him a digital & tech geek. He has over a decade of experience solving tech problems and creating digital solutions. Follow him on Twitter and LinkedIn.

Share us your thoughts and feedback

Your email address will not be published. Required fields are marked *