How to block YouTube (and keep your lectures)

Sameed Ahmad
By Sameed Ahmad, who builds Focus AI (so read the Focus AI parts with that in mind).
Updated October 2026
Short answer: to block all of YouTube on Chrome, use a blocker extension or your hosts file. To block only Shorts, use a filter extension. If you study from YouTube, a normal blocker will block your lectures too, so you need something that judges each video, not the whole site. All of these are below, free ones first.

YouTube is the hardest site to block honestly, because sometimes you need it. The trap is rarely the video you searched for. It's the sidebar, the autoplay queue and the Shorts shelf that come after it.

1. Block all of YouTube on Chrome with an extension

  1. Install a website blocker from the Chrome Web Store (BlockSite, LeechBlock NG and StayFocusd are common).
  2. Add youtube.com to its block list. Most blockers cover www and m. automatically.
  3. Open chrome://extensions, click Details on the blocker and turn on Allow in Incognito.

Good for: you never need YouTube during work. Gives up: it blocks lectures, tutorials and videos embedded in your course site, and turning the extension off takes two clicks.

2. Block YouTube on a laptop or PC without an extension

Add these lines to your computer's hosts file (Notepad as administrator on Windows, sudo nano /etc/hosts on a Mac): 127.0.0.1 youtube.com, 127.0.0.1 www.youtube.com, 127.0.0.1 m.youtube.com and 127.0.0.1 youtu.be. Restart Chrome. It blocks YouTube in every browser on that computer. Step-by-step hosts file instructions.

Good for: a permanent, free block. Gives up: it's all or nothing, and the same one-minute edit undoes it.

3. Block YouTube on a Chromebook

On a personal Chromebook, Chrome extensions install exactly as on a laptop, so method 1 works. On a school-managed Chromebook the school controls extensions and blocked sites. For a child's Chromebook, Google Family Link lets a parent block YouTube from their own phone.

4. Block only YouTube Shorts and recommendations (free)

Filter extensions such as Unhook remove the home feed, recommendations, autoplay, comments and Shorts. The video you open plays normally; the sidebar that pulls you away is gone. More on blocking Shorts.

Good for: people whose problem is autoplay and the sidebar. Gives up: the search bar still works, so when the urge is strong you type the rabbit hole in yourself, and the filter is one click from off.

5. Block YouTube but keep your lectures

This is the version most students actually need. Three ways, from free to strict:

Queue the lectures first, then block everything (free)

Put tonight's lectures in a playlist or download them where your course allows, then block YouTube completely. Works for fixed course material; the moment you need a video you didn't plan for, you're back to unblocking the whole site.

Allowlist specific channels or playlists (free, fiddly)

Rule-based blockers such as LeechBlock NG can block youtube.com while allowing URL patterns, like one playlist or your professor's channel. Fine for one course with one source; real studying pulls from many channels, and every new one means editing rules mid-session.

Block by task, not by site

This is what I built Focus AI for, so weigh it accordingly. You type what you're studying and pick a session length. Every page is judged against that task: the SN2 lecture loads, the recommended video essay doesn't, Shorts don't. There is no list to maintain, so there's nothing to unblock when you need a new source. Strict mode is on by default: ending a session early means typing a sentence, and the extensions page is blocked while you're locked in.

Gives up: it costs money after 3 free sessions, it occasionally misjudges a page (a 3-minute Quick Check covers that), and it works in the browser only, not on your phone. Add Focus AI to Chrome.

FUTURE YOU IS WATCHINGLOCK IN

Keep the lecture, lose the rabbit hole

Type what you're studying. Everything that doesn't serve it is turned away. First 3 sessions free.

Add Focus AI to Chrome
First 3 sessions free · 30-second setup · No account needed

Which one should you use?

Frequently asked questions

How do I block YouTube on Chrome?

Install a website blocker extension from the Chrome Web Store and add youtube.com to its list, then allow the extension in incognito under chrome://extensions. Without an extension, add youtube.com and www.youtube.com to your computer's hosts file.

Can I block YouTube but still watch lectures and tutorials?

Not with a normal blocker, because it only sees the domain youtube.com. You need a tool that looks at each page: a filter that hides recommendations and Shorts, an allowlist of specific channels or playlists, or a blocker like Focus AI that judges each video against what you're studying.

How do I block YouTube Shorts only?

Use a filter extension that hides the Shorts shelf and blocks youtube.com/shorts pages while normal videos still play. Domain blockers and the hosts file can't do this, because Shorts lives on the same domain as everything else.

How do I block YouTube on a school Chromebook?

If the Chromebook is school-managed, extensions and blocked sites are controlled by the school's administrator, so you usually can't add your own. On a personal Chromebook, extensions install normally and every method here works.

What about YouTube in incognito mode?

Extensions are off in incognito by default, which is the classic loophole. Open chrome://extensions, click Details on your blocker and turn on Allow in Incognito. Focus AI also blocks the extensions page during a session, so switching the blocker off isn't an option mid-session.

Does YouTube Restricted Mode help with studying?

No. Restricted Mode filters mature content. Gaming, commentary and endless recommendations all stay.

How does Focus AI decide what is a lecture?

Before a session you type what you're working on, for example 'organic chemistry: SN1 vs SN2'. Each page, including each YouTube video, is judged against that task. A lecture on SN2 reactions loads; a video essay about a video game does not. If it gets one wrong, a 3-minute Quick Check lets you through once per session.

Related