Home > News Tips

How to Block a Website on Mac [Unblocking Included]

Updated on Tuesday, August 27, 2024

iBoysoft author Jessica Shee

Written by

Jessica Shee

English Français Deutsch やまと Español Português

Blocking specific websites is useful when you want to prevent your children, employees, or students from accessing certain content on the internet. Mac computers provide several ways to help you create a backlist of websites. You can also use third-party apps, web browser extensions, and plug-ins to block websites on a Mac.

Read on to learn how to block and unblock websites on Mac. The following steps apply to macOS 13 Ventura, so if your Mac has an older version of macOS, the specific procedures and options may vary.

How to block a website on Mac:

MethodsEffectivenessDifficulty
Enable Parental ControlsHigh - It can accurately block certain websites for specific users.Easy
Modify the Hosts fileHigh - It doesn't allow your Mac to open the websites once they are restricted.Easy
Install apps and extensionsHigh - Website blockers and parental control tools are easy to set up and effective.Easy
Adjust router settingsHigh - It blocks websites for all users on the same network. 

 

Block a website on Mac by enabling Parental Controls

macOS has a built-in website blocker in Screen Time to allow a parent or legal guardian to restrict a family member, usually a child under 14 years old, from visiting certain websites, especially adult websites.

Steps to block a website on Mac using Screen Time

Step 1. Click the Apple logo to open the Apple menu and choose System Settings in the drop-down options.

Step 2. If you have set up Family Sharing, click the Family icons to choose the family member you want to restrict from visiting certain websites.

Select family member to restrict access

Step 3. In the Screen Time window, click Content & Privacy.

Block a website on Mac in Screen Time

Step 4. Toggle the slider to turn on the Content & Privacy restrictions and open Content Restrictions.

Enable Content and Privacy Restrictions on Mac

Step 5. In the Access to Web Content section, select Limit Adult Website. Alternatively, you can select the Allowed Websites Only option, which blocks all websites on Mac except for the ones you allow.

Limit web content access on Mac

Step 6. Click the Customize button and a window pops up to let you add websites you allow and websites you want to be restricted.

Create blacklist of websites on Mac

Step 7. Click the plus icon, enter the website URL, and click Done.

Add a website URL to block

Step 8. Click Done and all websites in the Restricted list will be blocked on Mac.

Is this article helpful? If it is, please share it on your social media pages to help others.

 

How to unblock a website by turning off the Content & Privacy restrictions

If you want to unblock all restricted websites, the easiest way is to completely turn off Content & Privacy restrictions on Mac.

Step 1. Open the Apple menu > System Settings > Screen Time.

Step 2. Click Content & Privacy and disable it. Or open Content Restrictions and choose Unrestricted Access.

Unrestricted access to web content on Mac

If you want to remove one or some restricted websites from the blacklist, follow the steps below:

Step 1. Open the Apple menu > System Settings > Screen Time.

Step 2. Click Content & Privacy > Content Restrictions > Customize.

Step 3. Select the website you want to unblock, click the minus icon to delete it, and click Done.

Create a blacklist of websites on Mac with Mac Terminal

The Hosts file on Mac lets you override DNS settings exactly as specified. If you have an administrator's account (the account you used to initially set up your Mac), you can use your administrative privilege to modify the Hosts file to block websites on Mac. Blocking a website with Mac Terminal to change the Mac's Hosts file is a simple process.

Steps to block a website on Mac with Terminal

Step 1. Use the Command + Tab to open Mac's Spotlight Search, type in Terminal, and double-click the Terminal app to open it.

Step 2. Type the command below to open up the Host file.

sudo nano /private/etc/hosts

Open Hosts file on Mac

Step 3. Hit Return and you will be prompted to enter your password.

Step 4. Type in your admin password and hit Return. While you are typing, it is normal that no numbers or letters show up.

Step 5. In the Hosts file editor, use the downward arrow key on your keyboard to move the cursor to the line 127.0.0.1 localhost; use the right arrow key to move the cursor to the end of the line and press Return to open a new line.

Hosts file editor on Mac

Step 6. Enter the website you want to block using the format 127.0.0.1 <tab><website url>. For example,

127.0.0.1 www.espn.com

If you have multiple websites you want to block, just use the Return key to open other new lines and add them.

Add websites to block with Mac Terminal

 Tips: If you can still access the website you blocked, your browser must access a different subdomain. To solve the problem, you can add more lines in the Hosts file such as

127.0.0.1 URL without the "www"

127.0.0.1 m.(URL) which blocks the mobile version of the website

Step 7. Press the Control + O keys together to save your changes to the Hosts file and use Control + X to exit the editor.

Step 8. Close the Terminal app and test it to see if the website is blocked.

Now that you know how to block a website on Mac. Share it with your followers. 

 

How to unblock a website blocked by an administrator on Mac

Now that you have learned how to block a website on Mac with an admin account, you will also want to know how to unblock a website blocked by an administrator on Mac.

Step 1. Open Terminal and run the command below to open the Hosts file:

sudo nano /private/etc/hosts

Step 2. Type in your password and hit Return.

Step 3. Use the arrow keys to locate the line of the blocked website.

Step 4. Delete the entire line or add a pound symbol # at the beginning of the line. Either way will allow the system to load the website for you.

Unblock a website on Mac with Terminal

Step 5. Press Control + O to save the changes and Control + X to exit the Hosts file editor.

Restrict access to websites on Mac using apps and extensions

Another way to prevent your Mac from loading certain websites is to employ external software. There are plenty of web browser extensions and applications that are designed to block websites and online content for parental control and productivity improvement.

You can access the Google Chrome extension store or Safari extension store to search for content blockers or parental control tools. These tools are easy to set up and will allow you to add website lists to block. The main drawback is that they only work on the web browser you install the extension on.

Alternatively, you can install a content-blocking app on your Mac computer. However, these apps usually offer paid plans.

How to block a website on Mac by adjusting the router's settings

You can use the router's built-in parental control and monitoring features to stop users on your home or office network from opening specific websites. Almost all routers allow the administrator to restrict access to websites or the internet for specific devices or people.

How to block a website on your router

Step 1. Open the Apple menu > System Settings > Network.

Step 2. Click the Details of the connected network and go to the TCP/IP tab.

Step 3. Copy the router's IP address.

Find router IP address on Mac

Step 4. Open a web browser, paste the router's IP address to the address bar, and hit Return.

Step 5. Enter your router's username and password on the router's page. The information usually can be found on the router device or its manual.

Step 6. Locate the parental control, time limits, blocked sites, or something similar in your router's settings.

Step 7. Follow the onscreen steps to set up websites you want to block.

We would appreciate it if you could share this article on your social media profiles.

 

Bonus tip: How to unblock a website on Mac with a VPN

If you are unable to access a website on Mac, it may be blocked by your ISP or it is geo-restricted. In this case, a VPN, a Virtual Private Network, can help you unblock the site and access its content.

Your IP address will be changed as a result of the VPN's rerouting of your internet traffic through a VPN service's remote server, allowing you to browse the web anonymously and avoid any geo-restrictions. Read to know how to set up a VPN on Mac.