Sometimes, YouTube can become a distraction, and blocking YouTube on Microsoft Edge might be exactly what you need.
In this guide, you’ll learn how to block YouTube on Microsoft Edge step by step.
Block YouTube on Microsoft Edge

Before you begin, decide whether you want to block YouTube just in Edge or across your entire computer. This distinction matters because an Edge extension usually affects only that browser, while computer-level or network-level restrictions can affect other browsers and apps, too.
Method 1: Block YouTube Using a Website-Blocking Extension
This is one of the easiest options if you want to stop yourself from opening YouTube while working or studying.
A website-blocking extension can prevent access to selected websites, redirect you away from distracting pages, or limit the time you spend on them.
Step 1: Open Microsoft Edge
Launch Microsoft Edge on your Windows computer. Make sure you’re using the browser profile where you want the restriction to apply.
Step 2: Open the Edge Add-ons Store
Select the three-dot menu in the upper-right corner of Edge and look for Extensions. Choose the option to manage extensions, then open the link to get extensions from the Microsoft Edge Add-ons store.
You can also visit the official Edge Add-ons website directly by entering its address in the browser.
Step 3: Find a website-blocking extension
Search for a website blocker that supports custom website restrictions. Review its description, ratings, permissions, update history, and privacy policy before installing it.
Choose an extension that lets you add specific websites to a blocklist. Avoid extensions that request unnecessary access to personal information or browsing data.
Step 4: Install the extension
Open the extension’s listing and select the option to get or install it. Review the requested permissions and confirm the installation if you’re comfortable with them.
Once installed, open Edge’s Extensions menu and locate the new extension.
Step 5: Add YouTube to the blocklist
Open the extension’s settings and find the section for blocked websites or restricted URLs.
Add youtube.com to the list. If the extension supports separate subdomains, consider adding www.youtube.com and m.youtube.com as well.
Some extensions automatically cover subdomains, so check their settings before adding multiple entries.
Step 6: Test the restriction
Open a new tab and visit YouTube. If the extension is configured correctly, it should block the page or display a restriction message.
If YouTube still loads, check whether the extension is enabled and whether its rules cover the address you’re visiting.
Best for: People who want a quick, flexible way to block YouTube without changing Windows settings.
Keep in mind that this approach can be bypassed if someone disables or removes the extension, uses another browser, or opens YouTube through a different app.
Method 2: Block YouTube Using the Windows Hosts File
If you want a restriction that applies to normal website access across browsers on your Windows computer, you can edit the Windows hosts file.
This method maps selected domain names to an IP address. By mapping YouTube domains to the local computer address, you can prevent many ordinary attempts to reach those domains.
However, this is not a complete security barrier. YouTube may use additional domains, and some apps, network configurations, or encrypted DNS arrangements may behave differently.
Step 1: Open Notepad as an administrator
Open the Start menu and search for Notepad.
Right-click Notepad and select Run as administrator. Approve the Windows permission prompt if it appears.
Administrator access is necessary because the hosts file is protected.
Step 2: Open the hosts file
In Notepad, select File, then Open.
Navigate to the following folder:
C:\Windows\System32\drivers\etc
Change the file-type filter from text documents to All files. Select the file named hosts and open it.
Before making changes, consider creating a backup copy so you can restore the original file if needed.
Step 3: Add the YouTube domain entries
At the end of the file, add these lines:
127.0.0.1 youtube.com
127.0.0.1 www.youtube.com
127.0.0.1 m.youtube.com
These entries direct those domain names to your own computer instead of their normal destinations.
You may need additional entries for other YouTube-related domains, depending on what you are trying to block. Be aware that adding domains carelessly can affect related services.
Step 4: Save the file
Select File, then Save. If Windows reports that you do not have permission, confirm that Notepad was opened as an administrator.
Make sure the file is saved as hosts, not hosts.txt.
Step 5: Clear the DNS cache
Open Command Prompt as an administrator and run:
ipconfig /flushdns
This clears cached DNS records on Windows. It does not guarantee that every browser or app will immediately respect the new restrictions.
Step 6: Test YouTube in Edge
Close any existing YouTube tabs, open a new one, and try visiting the site.
If YouTube still loads, the hosts file may not cover every relevant domain, or another DNS or network configuration may be involved.
Best for: Users who want a computer-level restriction and are comfortable editing Windows system files.
To undo the change, reopen the hosts file as an administrator, remove the entries you added, save the file, and flush the DNS cache again.
Method 3: Use Microsoft Family Safety to Restrict YouTube
If your goal is to block YouTube for a child, Microsoft Family Safety may be a better fit than a standard browser extension.
Family Safety offers parental controls for supported Microsoft accounts and devices. Its web-filtering features are designed primarily for Microsoft Edge, and their behavior depends on the child’s account, device configuration, and current settings.
Step 1: Set up a family group
Open Microsoft Family Safety and sign in with the Microsoft account used to manage your family.
If you have not already done so, create a family group and add the child’s Microsoft account.
Step 2: Select the child’s account
Open your family dashboard and select the child’s profile.
Review the available content-filtering options for that account and device.
Step 3: Find the web-filtering settings
Open the relevant content-filtering or web-filtering section. Depending on the current interface, you may see options to filter inappropriate websites and manage allowed or blocked sites.
Enable the appropriate web-filtering feature and make sure the child uses their own managed account in Microsoft Edge.
Step 4: Add YouTube to the blocked websites list
If your Family Safety settings provide a blocked-sites list, add youtube.com and any relevant address variations that the interface allows.
Save the changes and check that the restriction applies to the child’s account.
Step 5: Test the restriction
Sign in to the child’s Windows account and try opening YouTube in Edge.
If the website remains accessible, confirm that web filtering is enabled, the correct child account is being used, and the device meets the feature’s requirements.
Best for: Parents who want to manage a child’s browsing and other supported family settings.
Family Safety is not a universal block across every browser and device. Check Microsoft’s current requirements and limitations before relying on it.
Method 4: Block YouTube Through Your Router
What if you want to block YouTube on several devices connected to your home network?
In that case, router-level website filtering may be worth considering. Depending on your router, parental-control settings, or DNS filtering service, you may be able to restrict YouTube for selected devices or across your entire network.
Step 1: Open your router’s administration page
Connect to your home network and open the router’s management address in a browser. The address and sign-in details depend on your router model.
Step 2: Find parental controls or website filtering
Look for settings labeled Parental Controls, Access Restrictions, Website Filtering, or similar.
Not every router supports domain blocking, and some only offer time limits or device scheduling.
Step 3: Add YouTube to the restriction list
If domain blocking is supported, add the YouTube domains you want to restrict and select the relevant devices or network schedule.
Follow the instructions provided by your router manufacturer.
Step 4: Save and test the changes
Save your settings, then try opening YouTube in Edge on a device covered by the restriction.
Keep in mind that router rules may not work as expected if a device uses a VPN, mobile data, an alternative DNS service, or another connection outside your network.
Best for: Households that want to restrict access on several devices without configuring each browser separately.
Faqs
Can I block YouTube only on Microsoft Edge?
Yes. A website-blocking Edge extension is usually the simplest option if you only want to restrict YouTube in that browser. It may not stop access through other browsers or applications.
Can I block YouTube without installing an extension?
Yes. You can try the Windows hosts file or a compatible router-level filtering feature. These options require more configuration and may need maintenance.
Why is YouTube still opening after I blocked it?
Check that your extension is enabled, your domain entries are correct, and the changes have been saved. You should also check whether you are opening YouTube through a different domain, app, VPN, or network connection.
Can I block YouTube for a child?
Yes. Microsoft Family Safety may help you manage web access for a child’s account when its supported filtering features are configured correctly. You can also explore router-based parental controls.
Will blocking YouTube also block YouTube Music?
It depends on the method and the domains you restrict. YouTube Music may use separate web addresses or related services, so blocking only youtube.com may not block every Music feature.
Can I temporarily unblock YouTube later?
Yes. You can disable or edit an extension’s blocklist, remove your hosts-file entries, or adjust your router or family-filtering settings. Make sure you have permission to change any restrictions managed by someone else.
Which method should I choose?
For a quick personal restriction, start with an Edge website-blocking extension. For a computer-level restriction, consider the hosts file. For parental controls, look at Family Safety. For multiple devices, check whether your router supports website filtering.
Final Thoughts
Blocking YouTube on Microsoft Edge does not have to be complicated. The key is choosing a method that matches your needs.
If you’re trying to cut down on distractions while working or studying, a website-blocking extension is a practical place to start. If you want a restriction that applies beyond Edge, the Windows hosts file may help, although it is not foolproof. For children, Microsoft Family Safety offers parental-control features worth exploring. And if you want to manage several devices at once, router-level filtering may be the better option.
Whatever method you choose, test the restriction after setting it up.
A block that looks correct in the settings is not necessarily effective in every browser, app, or network configuration.