Guide · Updated November 3, 2026

How to block websites on a Mac, and turn the pop-up blocker on or off

Three ways to block a website on a Mac, from Screen Time to the hosts file, and which browsers each one covers. Then how to allow pop-ups for a site that needs them in Safari, Chrome and Firefox, and what to do about pop-ups that get through anyway.

macOS 26 Tahoe or later · No credit card · Everything runs on your Mac

The short answer: to block a site, open System Settings › Screen Time › Content & Privacy, turn it on, and add the site under Store, Web, Siri & Game Center Content › Web Content. To allow pop-ups for one site in Safari, open that site, choose Safari › Settings › Websites › Pop-up Windows and set it to Allow.

Block a website with Screen Time

Screen Time is built into macOS and needs no extra app. It is meant for parental controls, but works the same on your own account.

  1. Open System Settings › Screen Time. If you are setting it up for a child, choose their name first.
  2. Click Content & Privacy and turn it on.
  3. Click Store, Web, Siri & Game Center Content. Under Web Content, choose Limit Adult Websites, then click Customize.
  4. Under Restricted, click +, type the site's address, such as example.com, and click Done.

To allow only a short list of sites instead, choose Allowed Websites. Set a Screen Time passcode in Screen Time's settings so the block can't simply be switched off. The filter is built for Safari; check that it also blocks the site in any other browser on the Mac.

Block a website for every browser with the hosts file

The hosts file tells your Mac where to find a site before it asks the internet. Pointing a site at an address that goes nowhere blocks it in every browser and app that uses macOS for its lookups. It takes a few Terminal commands and your administrator password:

  1. Open Terminal and run sudo nano /etc/hosts.
  2. At the end of the file, add one line per address, such as 0.0.0.0 example.com and 0.0.0.0 www.example.com. Each subdomain needs its own line.
  3. Press Control-O and Return to save, then Control-X to quit.
  4. Clear the DNS cache with sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, and restart your browser.

To unblock the site, delete those lines the same way. Leave the lines that were already in the file alone; macOS needs them.

Other ways to block sites

  • A browser extension that blocks sites works only in the browser it is installed in, and is easy to turn off.
  • Your Wi-Fi router may have a site block or parental controls. That covers every device at home, but not your Mac on another network.
  • A blocker that works at the DNS level for the whole Mac, such as Tidy My Mac's Web Protection, covers every browser and app, subdomains included, with no Terminal commands.

How to allow pop-ups on a Mac

Browsers block most pop-up windows by default. Some sites, such as banking, payment and booking pages, open a window you need. Allow pop-ups for that site only, rather than turning the blocker off everywhere.

  • Safari: open the site, then choose Safari › Settings and click Websites. Click Pop-up Windows in the sidebar, find the site and set it to Allow. The setting at the bottom, When visiting other websites, is the default for every other site; Block and Notify is a good choice there.
  • Chrome: when Chrome blocks a pop-up, an icon appears at the end of the address bar; click it and choose to always allow pop-ups from that site. Or open Settings › Privacy and security › Site settings › Pop-ups and redirects and add the site under allowed sites.
  • Firefox: open Settings › Privacy & Security, scroll to Permissions, and next to Block pop-up windows click Exceptions to add the site.

Pop-ups that get through anyway

If ads keep appearing with the blocker on, they are usually not pop-up windows. Notifications from a site you once allowed show up in the corner of the screen even when the browser is closed: deny them in Safari › Settings › Websites › Notifications, or in Chrome's site settings. Ads on every site, new tabs that open by themselves, or a search engine that changed are signs of adware; see how to remove a browser hijacker. A pop-up that says your Mac is infected and gives a phone number is always a scam: see the “Apple Security Alert” scam.

Block sites with Tidy My Mac

  • Web Protection has an Always Block list: add a domain such as example.com and it is blocked in every browser and app, subdomains included. The same switch blocks phishing, scam and malware sites, and ads and trackers, from lists updated daily.
  • Adware finds the profiles, browser policies and proxies behind pop-ups that keep coming back, and lists any lines in the hosts file that send well-known sites elsewhere.
  • Browser Extensions shows which extensions can read every site you visit.

Questions about blocking websites and pop-ups

In Safari, choose Safari › Settings › Websites › Pop-up Windows and set the site you need to Allow. In Chrome, allow it from the icon in the address bar or in Site settings › Pop-ups and redirects. Allowing one site is safer than turning the blocker off for all.

Safari has no block list of its own. Use Screen Time's Content & Privacy settings, the hosts file, or a blocker for the whole Mac such as Web Protection.

Yes, with the hosts file or a blocker that works for the whole Mac. If Chrome's secure DNS setting is on, it may look sites up past macOS, so check that the block works.

Your browser may have it cached, or the site uses another address such as www or a country domain. Restart the browser, clear the DNS cache, and block the other addresses too.

Try every section free for 7 days.

Just your email, no credit card. Then $19.99 for your first year, $59.99 a year after that.

Start your free trial