How to Block a Website in Chrome (2 Ways)
In this article
Blocking a website in Google Chrome stops that site from loading on your device, which can help you avoid distractions, block harmful content, or keep certain pages off your family's computers. You can do this without installing extra software by using Chrome's built-in parental controls or by editing your computer's hosts file. This guide covers both methods, plus how to unblock a site later. No technical expertise is required for the first method, and the second takes about five minutes.
What You'll Need
- A computer (Windows, Mac, or Linux) with Google Chrome installed.
- Administrator access to your computer (to change system settings or install extensions).
- For the hosts file method: a text editor like Notepad (Windows) or TextEdit (Mac).
Step-by-Step
Method 1: Use Chrome's Built-in Parental Controls (Simplest)
- Open Google Chrome on your computer.
- Click the three-dot menu in the top-right corner, then select Settings.
- In the left sidebar, click You and Google (or Privacy and security depending on your version).
- Look for Parental controls and click Set up or Manage. If you don't see it, search for "parental" in the settings search bar.
- You'll be prompted to sign in with your Google account and create a supervised profile for the person whose browsing you want to restrict. Follow the on-screen instructions.
- Once the supervised profile is set up, go to Google Family Link (either on the web or the mobile app) and select the child's profile.
- In Family Link, go to Controls > Content restrictions > Google Chrome.
- Under Manage sites, click Add a site and enter the URL of the website you want to block (e.g.,
example.com). - Click Block. The site will now be blocked for that supervised profile.
Method 2: Edit Your Computer's Hosts File (Blocks for All Users)
- Close Chrome completely.
- Open your computer's hosts file with administrator privileges:
- Windows: Press
Windows + R, typenotepad, right-click Notepad in the results, and select Run as administrator. Then go toC:\Windows\System32\drivers\etcand open the file namedhosts(no extension). - Mac/Linux: Open Terminal and type
sudo nano /etc/hosts, then enter your password.
- Windows: Press
- At the bottom of the file, add a new line for each site you want to block. Use the format:
127.0.0.1 example.com
Replaceexample.comwith the actual domain (e.g.,127.0.0.1 facebook.com). Add one line per domain. - Save the file. In Notepad, choose File > Save. In nano, press
Ctrl + O, thenEnter, thenCtrl + Xto exit. - Clear Chrome's DNS cache: type
chrome://net-internals/#dnsin the address bar and click Clear host cache. - Restart Chrome. The blocked sites should now show a connection error.
Common Mistakes
- Blocking the wrong URL: If you block
example.com, subdomains likemail.example.commay still load. Block both the main domain and any subdomains you want to restrict. - Using HTTPS links in the hosts file: The hosts file only needs the domain name (no
https://orwww). Adding those will break the block. - Not clearing the DNS cache: After editing the hosts file, Chrome may still load the old IP address. Always clear the cache or restart the browser.
- Forgetting to save the hosts file as administrator: If you don't run your editor as admin, Windows will prevent you from saving changes.
- Blocking a site for the wrong profile: In Family Link, make sure you're editing the correct child's profile, not your own.
Tips
- For a more flexible solution, consider using a Chrome extension like BlockSite or StayFocusd. These allow you to set schedules, block specific pages (not just entire domains), and add password protection.
- If you're blocking a site for yourself, pair the block with a productivity tool that limits your ability to turn it off easily.
- To block a specific page (like a YouTube channel) rather than the whole site, use a site-blocking extension that supports URL patterns.
- Keep a backup of your hosts file before editing, so you can restore it if something goes wrong.
- Remember that tech-savvy users can bypass these blocks, so they're best used as a deterrent, not a security measure.
Troubleshooting
The site still loads after editing the hosts file. Make sure you added the correct domain and that there are no typos. Also, clear the DNS cache again and restart Chrome. If it persists, try using 0.0.0.0 instead of 127.0.0.1.
Chrome says "Site can't be reached" for all websites after editing hosts. You likely made a syntax error. Open the hosts file and check that each line starts with 127.0.0.1 or 0.0.0.0 followed by a space and the domain. Remove any extra spaces or characters.
Family Link blocks don't seem to work. Ensure the supervised profile is actually being used in Chrome (look for the "Supervised user" badge in the profile icon). Also, check that the site's domain is entered correctly and that the block is enabled.
You can't find the Parental controls option in Chrome settings. This feature is being phased out in some versions. If it's missing, use the hosts file method or install a third-party extension.
Frequently Asked Questions
Can I block a website on Chrome for Android or iOS?
Yes, but the methods differ. On Android, you can use Family Link or a third-party app. On iOS, you can use Screen Time. Chrome for mobile doesn't have built-in site blocking.
Does blocking a website in Chrome also block it in other browsers?
No. The hosts file method blocks the site system-wide for all browsers. The Family Link method only affects Chrome. If you want to block in all browsers, use the hosts file.
How do I unblock a website later?
For Family Link, remove the site from the blocked list. For the hosts file, delete the line you added and save the file. Then clear the DNS cache and restart Chrome.
Can I block a website without installing anything?
Yes. Both methods described above require no extra software. The hosts file method uses built-in tools, and Family Link is a Google service.
Will the website owner know I blocked their site?
No. Blocking happens on your device, so the website owner sees nothing unusual. They only see that your device didn't make a request to their server.
Is it legal to block websites on my own device?
Yes, it's fully legal to block websites on devices you own or manage. However, blocking sites on someone else's device without their consent may be against terms of service or local laws.