The fastest way to block YouTube depends on what you are trying to do
If you want to stop yourself or someone else from reaching YouTube on a specific computer, you have three main routes: use your browser's built-in tools, change your computer's network settings, or install blocking software. The method you choose depends on whether you are blocking it for yourself, for a child, or across all browsers on the machine.
Browser extensions work fastest if you only need to block YouTube in one browser and you are willing to manage the block yourself. Network-level blocking (through your router or hosts file) stops YouTube across every browser and process on the computer, but requires more setup. Parental control software gives you the most oversight if you are managing access for someone else.
Key Takeaways
- Browser extensions like LeechBlock NG or Freedom block YouTube in seconds and let you set schedules, but only work in that specific browser.
- Editing your computer's hosts file blocks YouTube across all browsers without installing software, though the block can be removed if someone knows where to look.
- Router-level blocking stops YouTube on every device connected to your WiFi, making it the hardest method to bypass without changing networks.
- Windows Parental Controls and macOS Screen Time let you restrict YouTube access by time of day or set content filters, useful if you manage access for a child.
- YouTube's own Restricted Mode, built into the platform, filters mature content but does not block the site entirely and can be turned off by the user.
Using a browser extension to block YouTube
LeechBlock NG is the fastest option if you use Chrome, Firefox, or Edge. Install it from your browser's extension store, open the settings, add youtube.com to the blocked sites list, and set the times you want it blocked. You can block it all day, only during work hours, or on a schedule you choose. The extension runs in the background and stops you from reaching YouTube even if you try to type the address directly.
Freedom is another option that works across browsers and devices if you pay for it. It blocks YouTube, Reddit, social media, and other sites you choose, and syncs your settings across your phone and computer. The free version of LeechBlock NG does the same job for YouTube alone and costs nothing.
The weakness of browser extensions is that they only work in that one browser. If you use Chrome but someone else uses Firefox on the same computer, they can reach YouTube in Firefox. If you want to block YouTube across all browsers, use the hosts file method instead.
Blocking YouTube through your computer's hosts file
Your computer has a file called the hosts file that tells it which web addresses go to which servers. By editing this file, you can redirect youtube.com to a fake address so it never loads, no matter which browser you use.
On Windows: Open Notepad as administrator (right-click Notepad, select "Run as administrator"). Go to File > Open and navigate to C:\Windows\System32\drivers\etc. Select "All Files" from the dropdown so you can see the hosts file. Open it. At the bottom of the file, add these two lines:
127.0.0.1 youtube.com 127.0.0.1 www.youtube.com
Save the file. YouTube will no longer load in any browser on that computer. To unblock it, delete those two lines and save again.
On Mac: Open Terminal (find it in Applications > Utilities). Type sudo nano /etc/hosts and press Enter. You will be asked for your password. Add the same two lines above. Press Control+X, then Y, then Enter to save. The block takes effect when ready.
This method blocks YouTube across all browsers and applications, but anyone with administrator access to the computer can undo it by editing the hosts file again. It is not a strong barrier against someone determined to reach YouTube, but it is effective against accidental visits.
Blocking YouTube at the router level
If you want to block YouTube on every device connected to your WiFi — phones, tablets, laptops, everything — you can do it through your router's settings. This is the hardest method to bypass because it stops YouTube before it even reaches individual devices.
Log into your router's admin panel by typing your router's IP address (usually 192.168.1.1 or 192.168.0.1) into a browser address bar. Look for a section called "Parental Controls," "Access Control," or "Content Filtering." Add youtube.com to the blocked sites list. The exact steps vary by router brand, so check your router's manual or manufacturer website for specific instructions.
The advantage is that no one can bypass it by switching browsers or using a different device on your network. The disadvantage is that it blocks YouTube for everyone, including guests, and requires you to know your router's admin password. If someone knows that password, they can remove the block themselves.
Using Windows Parental Controls to restrict YouTube
If you manage a child's computer, Windows Parental Controls (called Family in Windows 10 and later) lets you set time limits and content restrictions without blocking YouTube entirely.
Open Settings > Accounts > Family & other users. Select the child's account and choose "Screen time" or "App and game restrictions." You can set how many hours per day they can use the computer, block specific apps, or set a content filter. The content filter does not block YouTube by name but can restrict access to sites marked as mature.
This method is useful if you want to limit YouTube use rather than eliminate it, or if you want to allow it only at certain times. The child can request more time, and you can approve or deny the request from your own account.
Using macOS Screen Time to manage YouTube access
On Mac, Screen Time works similarly to Windows Parental Controls. Open System Preferences > Screen Time, select the child's account, and set downtime (hours when the computer is locked), app limits (how long they can use certain apps), or content restrictions.
You can restrict access to websites by category or add specific sites to a blocklist. YouTube is not blocked by default in any category, but you can add it to the restricted sites list manually. Like Windows, Screen Time lets you set time-based limits rather than a complete block, and the child can request more time.
YouTube's Restricted Mode as a built-in filter
Restricted Mode is a setting within YouTube itself that filters out videos marked as mature. It does not block YouTube entirely — the site still loads and plays videos — but it hides content YouTube's system flags as potentially inappropriate.
To turn on Restricted Mode, scroll to the bottom of any YouTube page, click your profile icon, and select "Restricted Mode: On." The setting stays on in that browser until you turn it off. Restricted Mode is not a strong barrier because the user can turn it off at any time, and it relies on YouTube's content flagging, which is not perfect.
Use Restricted Mode if you want to filter content rather than block access entirely. Combine it with one of the methods above if you need a stronger barrier.
Frequently Asked Questions
Can someone unblock YouTube if I block it through the hosts file?
Yes, if they have administrator access to the computer. They can open the hosts file the same way you did and delete the lines you added. If you want to prevent that, use parental controls or router-level blocking instead, which require a password to change.
Will blocking YouTube at the router stop it on mobile phones too?
Yes, any device connected to your WiFi will be blocked. If someone switches to cellular data instead of WiFi, they can still reach YouTube. To block YouTube on mobile devices, you would need to use the phone's built-in parental controls or a mobile-specific blocking app.
What is the difference between blocking YouTube and using Restricted Mode?
Blocking YouTube stops the site from loading at all. Restricted Mode lets YouTube load but hides videos marked as mature. Restricted Mode is easier to turn off and does not block the site, so it is better for filtering content. Blocking is better if you want to prevent access entirely.
If I block YouTube in Chrome, will it be blocked in Firefox too?
No, browser extensions only work in that browser. If you want to block YouTube across all browsers, use the hosts file or router-level blocking instead.
Does blocking YouTube through the hosts file affect internet speed?
No, it does not slow down your connection. It straightforward redirects YouTube's address to a non-existent server, so the site fails to load but nothing else is affected.