How to block YouTube on a Mac: what holds, and what leaks
Of all the sites people try to keep off their own machine, YouTube is the one that gets back in. It isn't one page — it's a homepage, a search engine, a Shorts feed, an embed on half the web, and a phone in your pocket on the same account. So most guides on how to block YouTube on a Mac hand you one method, and the method leaks somewhere you didn't think to check. Here's what each approach covers, and where it gives out.
First decide what you're actually blocking
Three quite different problems get the same search query, and they don't have the same answer.
- Somebody else's Mac. You want a block that survives another person looking for a way around it. That means Screen Time with a passcode, or filtering above the machine entirely.
- Your own reflex. You don't need something unbreakable, only something that outlasts the ten seconds in which you want it gone. A hosts entry does that; a browser extension does not.
- The feed, not the site. This is most people: you want to look up how to replace a washer without the homepage offering you a forty-minute essay on airport design. Blocking the domain is the wrong tool for that, and the last section has a better one.
How to block YouTube on a Mac with Screen Time
Screen Time is already on your Mac and it takes about a minute. In System Settings → Screen Time → Content & Privacy, turn on Content & Privacy Restrictions, open App Store, Media, Web & Games → Web Content, choose Limit Adult Websites, click Customize, and add YouTube to the Restricted list. Add both:
youtube.com
youtu.be
The second one is the share-link domain. Every link copied from the
YouTube app or the Share button is a youtu.be link, so leaving it out
leaves the most common route in wide open.
A Screen Time passcode makes future-you type four digits to undo it, and with the same Apple Account and Screen Time sharing on, the block follows you to your iPhone — which matters more for YouTube than for almost any other site.
The catch sinks most people: the restricted list is reliable in Safari and inconsistent in third-party browsers. Test it where you actually browse, and if it doesn't hold, put a one-minute App Limit on that browser instead — app limits never have to understand a URL. The full guide to blocking sites on a Mac covers both routes in detail.
The hosts file: every browser, one edit
A hosts entry sits below the browser, at name resolution, so it applies
to everything on the Mac at once. Open it with sudo nano /etc/hosts and
add:
127.0.0.1 youtube.com
127.0.0.1 www.youtube.com
127.0.0.1 m.youtube.com
127.0.0.1 youtu.be
127.0.0.1 www.youtube-nocookie.com
Save, then flush the cache:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Two YouTube-specific notes. First, this also kills embedded videos
everywhere else — the embed on a documentation page is an iframe pointed
at www.youtube.com or youtube-nocookie.com, so it goes down with the
site. For many people that's a feature; if you follow tutorials for a
living it's a real cost.
Second, don't bother chasing googlevideo.com, where the video bytes
come from. Its hosts are randomly named — rr3---sn- plus a string of
characters — and a hosts file has no wildcards. You don't need them:
block the page and the player never loads to ask.
DNS filtering: the version that covers your phone
Point your Mac — or your router — at a filtering resolver like NextDNS, AdGuard DNS or a Pi-hole, and block YouTube there. It's the one approach that handles the loophole every Mac-only block has: you close the laptop and pick up the phone. It also survives a new browser and a new user account.
Two blind spots. A browser with DNS over HTTPS on resolves names itself and never asks your resolver, so turn secure DNS off there. And a phone on cellular has left your network — for that you're back to Screen Time with a passcode.
If it's the feed you want gone, not YouTube
Most people who search for this don't want YouTube gone. They want the homepage to stop recommending things. There are two good moves, and neither one blocks anything.
Pause your watch history. In your Google account's activity
controls, turn off YouTube watch history. Recommendations are built on
it, and YouTube now ties the home feed to it directly — since a wave of
reports in April 2026, people with history paused get a near-empty
homepage and a prompt to turn it back on. That's the outcome you were
trying to buy with a blocker, for free, from YouTube itself. Search
still works and the Subscriptions tab is unaffected — neither is the
recommendation feed. Bookmark youtube.com/feed/subscriptions and make
that your front door.
Hide Shorts. There is still no official permanent switch. The X on the Shorts shelf hides it for 30 days and the three-dot menu offers "show fewer Shorts"; for anything permanent you need an extension. Unhook is the usual answer, switching off the homepage feed, Shorts, related videos, comments and endscreens individually. It's a Chrome, Edge and Firefox extension — Safari's catalogue is thinner here, which is a fair reason to keep YouTube in a second browser.
Which method should you use?
| Method | What it stops | Where it leaks |
|---|---|---|
| Screen Time restricted list | YouTube in Safari; follows you to iPhone | Third-party browsers, inconsistently |
| Screen Time App Limit on the browser | All browsing in that browser | Open a different browser |
| Hosts file | Every browser and app on the Mac | A one-line edit undoes it; DoH browsers |
| DNS filtering / Pi-hole | Every device on your network | Cellular; DoH in a browser |
| SelfControl, Cold Turkey, Freedom | Sites for a fixed, unbreakable timer | Your phone, unless it syncs |
| Paused history + Unhook | The feed, while keeping search | Nothing is blocked — it's a habit change |
If you've talked yourself past your own blocks more than once, take the timer. SelfControl is free and open source, and its block stands until it expires — quitting, deleting or restarting won't lift it.
The reach a blocker doesn't catch
Once the site is gone, watch what your hand does next. The reflex that opened YouTube rarely starts with typing a URL — it starts with a browser window sitting in the corner of the screen, visible, at the exact moment the work gets hard.
That's a layout problem more than a willpower one. Give the work the whole screen, or a clean split with the one source you need, and make everything else something you switch to on purpose rather than something you can see. Let's Tile does the first half — one shortcut drops a grid over the current window, you steer with the arrow keys and press return, and the free 3 × 2 grid covers halves, thirds, quarters and full screen permanently. Let's Switch does the second: Option-Tab through your actual windows, most recent first, so a window being out of sight costs nothing to get back. Both are free to use, $9.99 once for the rest, no account and no telemetry. The deep work setup guide puts it together.
Frequently asked questions
Does blocking YouTube in Screen Time work in Chrome on a Mac?
Not dependably. Apple gives Safari an integration with Screen Time that third-party browsers don't have, and reports of the restricted list holding in Chrome are mixed and vary by macOS version. Test it, and if it fails, set a one-minute App Limit on Chrome instead.
Will blocking YouTube break embedded videos on other sites?
Yes, at the DNS or hosts level — embeds are iframes served from
www.youtube.com or youtube-nocookie.com, and a Screen Time entry
behaves the same way in Safari. There's no way to block the destination
and keep the embeds; they're the same domain.
How do I block YouTube on a Mac for free?
Screen Time's restricted list costs nothing. For every browser, add the
domains above to /etc/hosts. For a block you can't undo on impulse,
SelfControl is free and open source.
How do I block only YouTube Shorts?
You can't, at the network level — Shorts live on the same domain as everything else. Hide the shelf for 30 days with the X on it, or use an extension like Unhook to remove Shorts from the interface for good.