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.
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, I have shared written instruction about:
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:
- Click on the Apple on the menubar.
- Select the System Settings menu.
It will open the system settings window. - Switch to the Screen Time tab and select the Content & Privacy option to open.
- Toggle to turn on the Content & Privacy setting and select Content Restrictions within that page.
It will open a new Content Restriction settings page. - Switch the drop-down to Limit Adult Websites under the Access to Web Content option.
- Click the
button and add the website URL under the Restricted field. - Hit on 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.
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
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:
- Open the Terminal window on Mac.
It’s under the Applications folder. - Enter the command: sudo nano /etc/hosts and keypress the button.
- 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. - Keypress the down button to reach the end of the file.
- Add the following code; ensure to add a Tab space between the last digit and the site URL:
127.0.0.1 youtube.com
- Now, keypress + button to exit the editor.
- Keypress
to save the changes, and then to exit the editor. - 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.