This guide shows you how to prevent specific websites from loading in your browser, whether you want to block distracting sites, adult content, or anything else. You’ll learn several methods, from simple browser extensions to system-level changes, and how to pick the one that fits your needs.
What You’ll Need
- A computer (Windows, macOS, or Linux) or a mobile device (Android or iOS)
- The name or URL of the website(s) you want to block
- Administrator access to your device (for some methods)
- An up-to-date web browser (Chrome, Firefox, Edge, Safari, etc.)
Step-by-Step
- Identify the exact website addresses. Write down the full domain, like
example.com, not just “example.” If you want to block all subdomains (likemail.example.com), you’ll need to account for that in the method you choose. - Choose a blocking method. The best approach depends on your device and how tech-savvy you are. The most common options are:
- Browser extension (easiest): Works only in that browser, but simple to set up.
- Hosts file (system-wide): Blocks the site on your entire computer, regardless of browser.
- Router-level blocking: Blocks the site for every device on your home network.
- Parental control software or DNS filtering: Best for families or if you want to block categories of sites.
- Method 1: Use a browser extension (Chrome, Firefox, Edge).
- Open your browser and go to its extension store (Chrome Web Store, Firefox Add-ons, etc.).
- Search for “site blocker” or “website blocker.” Choose a well-reviewed extension with a high user count.
- Click “Add to Chrome” (or equivalent) and confirm any permissions it asks for.
- Click the extension’s icon in your toolbar, then click its settings or options page.
- Enter the website URL you want to block. Some extensions let you block by keyword or schedule.
- Save your settings. The site should now be blocked when you try to visit it.
- Method 2: Edit the hosts file (Windows, macOS, Linux).
- Open a text editor as administrator. On Windows, right-click Notepad and select “Run as administrator.” On macOS/Linux, open Terminal and use
sudo nano /etc/hosts. - Open the hosts file. On Windows, it’s at
C:\Windows\System32\drivers\etc\hosts. On macOS/Linux, it’s at/etc/hosts. - Add a line at the bottom that reads:
127.0.0.1 example.com(replaceexample.comwith the site you want to block). - Add another line for the
wwwversion:127.0.0.1 www.example.com. - Save the file. The change takes effect immediately (you may need to clear your browser cache).
- Open a text editor as administrator. On Windows, right-click Notepad and select “Run as administrator.” On macOS/Linux, open Terminal and use
- Method 3: Block at the router level.
- Find your router’s IP address (often
192.168.1.1or192.168.0.1). You can usually find it in your network settings or on the router itself. - Enter that IP in a web browser and log in with your router’s admin credentials.
- Look for a section called “Parental Controls,” “Access Restrictions,” or “Security.”
- Add the website URL to a block list. Some routers let you block by keyword or schedule.
- Save the settings. The block applies to all devices connected to that router.
- Find your router’s IP address (often
- Method 4: Use a DNS filtering service.
- Choose a DNS provider that offers content filtering (like OpenDNS FamilyShield or CleanBrowsing).
- Go to your router’s settings and find the DNS section.
- Replace the default DNS addresses with the filtering service’s addresses (they provide them on their website).
- Save the settings. The filter will now block known adult or malicious sites, but you can’t add custom URLs with the free tier of most services.
Common Mistakes
- Only blocking the
wwwversion. Many sites work without thewwwprefix, so you must block both. - Forgetting to clear your browser cache. After editing the hosts file, your browser may still show the old page. Clear your cache or restart the browser.
- Using a browser extension that can be easily disabled. If you’re blocking yourself, you might just turn it off. Consider a system-level method.
- Blocking the wrong domain. Some sites use different domains for their content (e.g.,
youtube.comandytimg.com). You may need to block multiple domains. - Not saving the hosts file correctly. On Windows, if you don’t run Notepad as administrator, you won’t be able to save the file.
Tips
- Use a schedule. Many extensions and routers let you block sites only during certain hours, like work hours.
- Block by keyword. Some tools let you block any URL containing a word, like “gambling” or “social.”
- Combine methods. Use a browser extension for quick blocks and a router-level block for a more permanent solution.
- Keep a list. If you use multiple methods, keep a list of the sites you’ve blocked so you can replicate them on other devices.
- Test the block. After setting up, try to visit the site from a different browser or device to make sure it’s actually blocked.
Troubleshooting
- The site still loads. Check that you’ve blocked both
example.comandwww.example.com. Clear your browser cache and restart the browser. If using a hosts file, make sure you saved it with administrator privileges. - The block only works in one browser. That’s expected if you used a browser extension. Use a system-wide method like the hosts file or router block.
- You can’t access the router settings. Check the router’s manual for the default login credentials. If they’ve been changed, you may need to reset the router (which will lose all settings).
- The hosts file edit doesn’t work. Some malware or security software may override the hosts file. Try using a different method.
- You accidentally blocked a site you need. Go back to the settings and remove the entry. For the hosts file, delete the line you added.
Frequently Asked Questions
Can I block websites on my phone?
Yes. You can use a browser extension on mobile (like Firefox or Kiwi Browser), or set up a router-level block that affects all devices. On iOS, you can use Screen Time; on Android, you can use Digital Wellbeing or a third-party app.
Will a VPN bypass my block?
Yes, a VPN can bypass most browser and hosts-file blocks because it changes your network route. Router-level blocks are also bypassed by VPNs. DNS filtering is more effective but can still be bypassed with a VPN.
Is it legal to block websites?
Yes, for your own devices and network. Blocking sites on a shared network (like a workplace) is legal as long as it’s allowed by the employer. However, blocking access to legal content for others without their consent may be unethical.
What’s the difference between blocking and hiding a website?
Blocking prevents the site from loading entirely. Hiding usually means removing it from your browsing history or bookmarks, but you can still visit it.
Can I block a website for a child but not for myself?
Yes. Use a router-level block with a separate guest network for your child’s devices, or use parental control software that allows different profiles for different users.
Why does the site still show up in Google search results?
Blocking the site prevents you from visiting it, but search engines still index it. The block only affects loading the page, not search results.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Campus Tech Innovation Hubs: What They Are
- Poco C51 Airtel Prepaid Locked Variant India?
- Jenkins vs GitHub Actions: Which CI/CD Fits Your Team?
- Turn Off Backup Encryption in iTunes?
- Shared VPS Hosting: Is It Better?
- Disk Defrag Pro: What It Does and Whether You Need It