TL;DR
To block websites on Safari on a Mac, use one of the following methods:
- Set up Screen Time in System Settings and choose Content & Privacy to limit adult websites or specify only allowed websites.
- Access your router’s settings via its IP address and use the Access Restrictions or Parental Controls to block specific websites.
- Install a web blocker extension from the App Store.
- Download and use third-party web blocker apps.
- Use the
sudo nano /etc/hosts
command to edit the host file via Terminal to block specific websites.
I know how easy it is to get distracted online, especially when trying to work or study on a Mac. That’s why I put together this guide with simple, straight-to-the-point steps that I use myself to keep focused. These methods really work whether you’re aiming to stay focused, manage your online activities, or just streamline your browsing.
Before We Begin
Besides blocking websites on your Mac, you should also remove adware and unwanted programs. Download MacKeeper and use its Adware Cleaner to avoid annoying pop-ups that send you to websites you don’t want to visit.
How to Block a Website on Safari on Mac
Why You Can Trust MacBook Journal We always conduct first-hand research and verify every method or solution we present, ensuring you receive reliable and effective advice. Learn more about our process.
There are different solutions for blocking websites on Safari. Below, I’ve shared some quick ways to block websites on Safari.
1. Use Screen Time
Screen Time is a feature in macOS, iOS, and iPadOS that allows you to set limits on app usage, including Safari. You can use Screen Time to block specific websites or categories of websites during certain times of the day. You can also use it to block all websites and whitelist some specific ones.
For macOS 10.15 Catalina or Later
Here’s how to use Screen Time to block websites on Safari on your Mac:
- Open the Apple menu and click System Settings.
- Click Screen Time in System Settings and select Content & Privacy.
- Click Content Restrictions.
- A new window will appear. Click the drop-down icon next to Access to Web Content and select Limit Adult Websites.
If you want to manage your time on specific websites using Safari, you can do that with Screen Time. Here are the steps for setting a time limit for certain websites on Safari on a Mac:
- Click Screen Time in System Settings and select App Limits.
- In the App Limits section, toggle on the App Limits switch and click the Add Limit button to create a new restriction.
- Scroll down to the end of the list until you find the option for Websites.
- Click the dropdown arrow next to Websites to specify which websites you want to set time limits for.
- Select a website from the list or add a URL.
- In the Time section, specify the time you wish to allow for this site. This is the duration for which you can access the site each day.
- Once you have set the time limit, click Done.
For iOS 12 or Later and iPadOS
Here’s how to use Screen Time to block websites on Safari on your iPhone or iPad:
- Open the Settings app on your iPhone.
- Tap Screen Time.
- If Screen Time isn’t already enabled, tap Turn On Screen Time, then tap Continue. If it’s for your iPhone, select This is My iPhone.
- Tap Content & Privacy Restrictions and toggle on the Content & Privacy Restrictions switch.
- Tap Content Restrictions and select Web Content.
- Select Limit Adult Websites.
- Tap Add Website in the Never Allow section.
- Type the website URL you want to restrict in the URL field and tap Done.
2. Change Router Settings
If you block websites through your router settings, it stops those sites on every device using your Wi-Fi. You just need to go into your router’s settings and choose the websites you want to block.
Here are the steps to block websites on Safari using router settings:
- Open your web browser and enter your router’s IP address in the address bar. You can usually find this information on the back of your router or in the manual.
- Enter your login credentials when prompted. The default username and password should be listed in your router’s manual if you need to change them.
- Look for the Access Restrictions or Parental Controls section in your router’s settings. It may be under the Advanced or Security tab.
- Choose the Website Blocking or Block Sites option.
- Enter the URL you want to block in the Website URL field. Some routers may also allow you to block websites based on keywords.
- Save the settings and exit the router’s interface.
3. Install A Web Blocker Extension
You can also add a browser extension to your web browser to do different things, including blocking websites. Safari doesn’t have a dedicated store for extensions, like Chrome. Instead, you have to download them from the App Store.
For Safari, I recommend a website-blocking extension called StayFree, a popular choice among Mac users.
For macOS 10.12 or Later
- Open Safari on your Mac.
- Click Safari in the menu bar and select Safari Extensions. This will open the App Store.
- In the App Store, type StayFree in the search bar and click Get > Install next to the app name in the results.
- Wait for the extension to install. Once it’s installed, you might get this notification in Safari. Click the Turn On Extensions button.
- Close Safari and reopen it. You should now see the extension’s icon near the address bar.
- To block a site, click the extension icon, and select Focus Mode Settings.
- It will open a new window. Click the Add Website button.
- Type the website URL and click Save. It will block the website and you won’t be able to reload it until you remove it from the Blocked Website list.
For iOS 15 or Later and iPadOS 15 or Later
iOS 15 and iPadOS 15 support web extensions for Safari. To add a Safari website blocker extension to your iPhone or iPad, follow these steps:
- Open Settings on your iPhone or iPad.
- Navigate to Safari.
- Select Extensions > More Extensions. This directs you to the App Store, showing compatible Safari extensions.
- Pick a web blocker extension for screen time control, and download it.
- Activate the Safari extension by going to Settings > Safari > Extensions.
- Find the web blocker extension you’ve installed and turn it on.
4. Use Third-Party Web Blocker Apps
Third-party web blocker apps offer another effective solution for managing online content access on Mac. These apps work by letting you make a list of websites you want to block. This stops you from accessing these sites for certain times you choose or all the time.
Here are some third-party web blocker apps that you might consider using:
- Cisdem AppCrypt: Cisdem AppCrypt is not just a website blocker, it also locks apps with a password. For website blocking, you can create a blacklist or whitelist and set up a schedule to block sites during certain times.
- 1Focus: 1Focus lets you block distracting websites and apps. It’s simple to use and lets you set periods of focus during which specific sites and apps are inaccessible. You can also schedule recurring focus sessions, making it a handy tool for establishing a routine.
- Freedom: Freedom is a popular app for blocking distracting websites and apps across multiple devices. It lets you create blocklists and schedule distraction-free sessions, making it a great tool for improving focus and productivity.
- SelfControl: Specifically for macOS, SelfControl lets you block access to distracting websites, mail servers, or anything else on the Internet. Once you set a period to block for, not even restarting your Mac or deleting the app will disable the block.
5. Map Domain Using Host Files/Terminal
Blocking websites in Safari on your Mac can be done by using host files. These files connect website names to their internet addresses. You can change these files to stop your Mac from reaching certain websites.
Here are the steps to map domain using host files:
- Open the Terminal application on your Mac. You can do this by searching for Terminal using Spotlight or by navigating to Applications > Utilities > Terminal.
- In the Terminal window, type the following command to open the host’s file and press Enter:
sudo nano /etc/hosts
- You will be prompted to enter your admin password. Enter it.
- Use the arrow keys to navigate to the bottom of the host’s file.
- To block a website, add the following line to the bottom of the file, replacing example.com with the URL of the website you want to block:
127.0.0.1 example.com
- You can add as many websites as you want by creating a new line for each website.
- Press Control ^ + O to save the changes to the host’s file.
- Press Control ^ + X to exit the editor.
- To make the changes take effect, flush the DNS cache on Mac by typing the following command in the Terminal:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- It will clear the cached DNS entries, forcing the Mac to use the updated host file.
Once you’ve completed these steps, Safari and other browsers on your Mac should no longer be able to access the websites you’ve blocked in the host file.
This method blocks the websites system-wide, so it will affect all users on your Mac. To unblock a website, remove the corresponding line from the host file and flush the DNS cache again.
How to Whitelist Specific Websites on Mac
Once you’ve set up Screen Time to limit websites, most adult websites will become inaccessible. But if you want to allow specific websites only, follow these steps:
- Follow the above steps from 1 to 3, and instead of Limit Adult Websites, select Allowed Websites Only in the Web Content window.
- Click the Customise button that appears.
- In the new window, click the + button in the bottom left corner.
- Type in the name and URL of the website you want to allow and tap Done.
- The website you add will appear in the list.
- Click Done to close the window.
Avoid Distractions While Browsing With MacKeeper
MacKeeper does not offer a feature to block websites on Safari. But it offers an Adware Cleaner that can detect and remove adware and potentially unwanted programs causing unwanted pop-ups or redirects to certain websites. This can indirectly help with blocking certain websites.
To use the Adware Cleaner feature in MacKeeper:
- Download and install MacKeeper on your Mac.
- Open MacKeeper and click Adware Cleaner in the left sidebar.
- Click Open.
- Click Start Scan to scan your system for adware and potentially unwanted programs.
- Once the scan is complete, review the list of detected items and select the ones you want to remove.
- If there are no malicious files, you’ll get a No items found message on your screen. Click Rescan to run the scan again or close the program.
While this may not directly block websites on Safari, removing adware and potentially unwanted programs can prevent unwanted pop-ups or redirects to those websites. So, it’s worth a try.
What Else Can MacKeeper Do?
Besides removing adware on your Mac, MacKeeper can block ads on your Mac, disable pop-ups on Safari and other browsers, and remove browser extensions. Check out my MacKeeper review to learn about these features.
Why Would You Need to Block Websites on Safari?
Blocking websites on Safari can be necessary for several reasons:
- 🎯 Focus and Productivity: If you find yourself frequently distracted by certain websites while working or studying, blocking them can help maintain focus and boost productivity.
- 👪 Parental Controls: For parents, blocking websites is a way to ensure children don’t access inappropriate content or spend too much time on entertainment sites.
- 🔒 Online Safety: Blocking websites that are known for phishing, scams, or malicious content helps protect your personal information and your device’s security.
- 📶 Bandwidth Management: In some cases, especially in a workplace, blocking websites that consume a lot of bandwidth (like streaming services) can help maintain network performance.
- 💆 Digital Well-being: Sometimes, blocking websites can be a part of a digital detox strategy, helping reduce time spent on addictive sites and improving overall well-being.
In each case, the goal is to create a safer, more focused, and more productive online environment.
Block Unwanted Websites on Safari and Be More Productive
Now that you know how to block websites on Safari, you may want to take your productivity up a notch. Here are some more tips to make your Safari experience better.
- Clear Safari cache on your Mac to improve its performance and prevent slow loading times.
- If your Safari is crashing on Mac, troubleshoot the problem by updating it and clearing the cache and cookies.
- Update Safari on Mac to prevent crashes and improve its security.