The most direct way depends on who you're blocking it from

Blocking YouTube works differently depending on whether you want to stop yourself from accessing it, prevent someone else in your household from reaching it, or restrict it on a device you control. The easiest method for one situation may not work for another. A parental control built into your router blocks YouTube for everyone on your Wi-Fi but requires access to router settings. A browser extension blocks it only in that browser on that device. A hosts file edit blocks it system-wide but requires technical steps. Understanding which method fits your situation saves you from setting up something that doesn't actually solve your problem.

Key Takeaways

  • Router-level blocking affects all devices on your Wi-Fi network and is the strongest option if you control the router, but requires you to log into your router's admin panel.
  • Browser extensions like LeechBlock NG or Freedom block YouTube only in that specific browser, so they work best if you want to restrict your own access on one device.
  • Operating system settings (parental controls on Windows, Screen Time on Mac and iOS, Digital Wellbeing on Android) block YouTube across all apps on that device but only if you set a restriction PIN.
  • The hosts file method blocks YouTube at the system level on Windows, Mac, or Linux, but changes revert if you restart or if YouTube's IP addresses change.
  • YouTube's built-in Restricted Mode filters some content but does not block the site itself and can be turned off by anyone with device access.

Blocking YouTube at the router level for your entire network

If you control your home Wi-Fi router and want to block YouTube for all devices connected to it, you can set this up in your router's admin panel. Log into your router by opening a browser and typing your router's IP address (usually 192.168.1.1 or 192.168.0.1) or the router's app if it has one. Look for a section called "Parental Controls," "Access Control," "Content Filtering," or "Website Blocking" — the exact name varies by router brand.

Once you find that section, you will typically enter YouTube.com or youtube.com into a blocked sites list. Some routers also let you block by IP address, which is more reliable because YouTube's servers can be harder to block by domain name alone. After you save the settings, anyone trying to visit YouTube on any device connected to your Wi-Fi will see a blocked message instead of the site. This method persists even if someone restarts their device, because the block happens at the network level before traffic reaches individual computers or phones.

The downside is that this blocks YouTube for everyone — including yourself if you want to use it. If you need to unblock it temporarily, you have to go back into the router settings, or someone can bypass it by using mobile data instead of Wi-Fi. If you forget your router's admin password, you may need to factory reset the router to regain access.

Using browser extensions to block YouTube on one device

Browser extensions like LeechBlock NG (for Chrome, Firefox, and Edge) or Freedom (for Chrome, Firefox, Safari, and Edge) let you block YouTube in your browser without touching your router or operating system settings. Install the extension from your browser's extension store, open its settings, and add youtube.com to the blocked sites list. You can set it to block the site during certain hours, require a password to unblock it, or block it permanently until you disable the extension.

This approach works well if you want to restrict your own access without affecting other people in your household. The block only applies in that specific browser on that specific device — if you open a different browser or use your phone, YouTube is still accessible. Some extensions let you set a "nuclear option" where you cannot disable the extension without entering a code you give to someone else, which removes the temptation to turn it off when you want to procrastinate.

The limitation is that determined users can uninstall the extension, switch browsers, or use incognito mode (which may bypass the extension depending on your settings). Extensions also do not block YouTube on apps — only in the browser.

Blocking YouTube using your device's built-in parental controls

Windows, Mac, iOS, and Android all have native parental control or screen time features that can block YouTube across all apps on that device. On Windows 10 and 11, open Settings, go to Accounts, then Family, and set up a child account or family group. You can then restrict that account's access to specific apps and websites. On Mac, open System Settings, go to Screen Time, and set App Limits or Communication Limits to restrict YouTube access.

On iPhone and iPad, open Settings, tap Screen Time, then Content & Privacy Restrictions, and add youtube.com to the restricted websites list. On Android, open Settings, go to Digital Wellbeing & Parental Controls, and set app timers or block apps entirely. All of these methods require you to set a PIN or password that others cannot guess — if you do not set a PIN, anyone can turn off the restrictions.

The advantage of using built-in controls is that they block YouTube everywhere on that device: in the app, in the browser, and in any other service that embeds YouTube videos. The disadvantage is that they are often designed for parental control of children's accounts, so the interface may feel clunky if you are restricting your own access. They also do not sync across devices — you have to set them up separately on each phone, tablet, or computer.

Editing the hosts file to block YouTube system-wide

The hosts file is a text file on your computer that tells your system which IP addresses correspond to which website names. By adding YouTube's domain names to your hosts file and pointing them to a fake IP address (usually 127.0.0.1, which is your own computer), you can block YouTube at the system level before any browser or app even tries to connect. This method works on Windows, Mac, and Linux.

On Windows, open Notepad as administrator, then open the file at C:\Windows\System32\drivers\etc\hosts. On Mac or Linux, open Terminal and type sudo nano /etc/hosts. Add these lines to the file:

127.0.0.1 youtube.com 127.0.0.1 www.youtube.com 127.0.0.1 m.youtube.com

Save the file and restart your computer. YouTube will no longer load on any browser or app. To unblock it, you have to edit the hosts file again and remove those lines. The downside is that YouTube's domain names and IP addresses change over time, so this block may stop working without warning. You also have to restart your computer for changes to take effect, and anyone with admin access to your computer can undo this edit.

YouTube's Restricted Mode and its limitations

YouTube itself offers a feature called Restricted Mode that filters out some mature content. To turn it on, scroll to the bottom of any YouTube page, click your profile icon, and toggle Restricted Mode on. YouTube will filter results and recommendations, though it does not block the site itself — you can still search for and find most content if you know what to look for.

Restricted Mode is useful as a content filter but not as a blocker. Anyone with access to your account or device can turn it off in seconds. It also does not prevent access to YouTube entirely, only to some videos within it. If your goal is to stop yourself or someone else from using YouTube at all, Restricted Mode alone will not do that.

Comparing the methods: which one to use

MethodBlocks across devicesAffects other peopleDifficulty to bypassBest for
Router blockingYesYes, everyone on Wi-FiHigh (requires router access)Blocking YouTube for entire household
Browser extensionNoNoLow (can uninstall)Restricting your own access in one browser
OS parental controlsNoDepends on accountMedium (requires PIN)Blocking on one device across all apps
Hosts fileYesYes, everyone on that computerMedium (requires admin access)System-wide block on one computer
Restricted ModeNoNoVery low (easy to turn off)Filtering content, not blocking access

Frequently Asked Questions

Can I block YouTube on my phone without using parental controls?

Yes. On Android, you can install a browser like Firefox and add a blocking extension to it, then set Firefox as your default browser — but this only blocks YouTube in that browser, not in the YouTube app. The most reliable phone-level block is to use your phone's built-in Digital Wellbeing (Android) or Screen Time (iPhone) settings, which block the app itself. You can also ask someone else to set a Screen Time or Digital Wellbeing PIN that you do not know, which makes it harder to turn off on impulse.

What happens if I block YouTube at the router and someone uses mobile data?

Router blocking only affects devices connected to your Wi-Fi network. Anyone using cellular data (4G, 5G, etc.) can still access YouTube because they are not going through your router. If you want to block YouTube on a phone regardless of connection type, you need to use the phone's own parental controls or a browser extension, not router-level blocking.

Can I block YouTube for one person in my household but not others?

Router blocking affects everyone on the network, so that will not work. Your best option is to set up a separate user account on a shared computer or tablet, then use that device's parental controls to block YouTube only on that account. On a phone, you can use parental controls on a child account, or ask the person to use a browser extension that you set a password for.

If I block YouTube using the hosts file, will it block YouTube videos embedded on other websites?

Yes. The hosts file blocks YouTube at the system level, so embedded videos from YouTube will not load anywhere — not just on YouTube.com itself. This is more restrictive than a browser extension, which typically only blocks the YouTube website and app, not embedded content.

How do I know if my router supports content filtering?

Log into your router's admin panel (usually 192.168.1.1 or through the router's app) and look for a section called Parental Controls, Content Filtering, Access Control, or Website Blocking. If you cannot find any of these sections, your router may not have built-in filtering. In that case, you can use a browser extension, OS-level controls, or the hosts file method instead.