The fastest way to block a URL depends on what you're using

You can block a website on your computer, phone, or home network. The method you choose depends on whether you want to block it just for yourself, for everyone on your Wi-Fi, or for a specific browser. Blocking on your device is fastest — it takes a few minutes. Blocking at your router level affects everyone connected to your home network. Blocking through your browser works only in that browser.

The most common reasons to block a URL are to stop distracting websites during work, prevent children from reaching certain sites, or avoid accidentally visiting a problematic domain. Each method has different strengths depending on your situation.

Key Takeaways

  • Browser extensions like Freedom, Cold Turkey, or LeechBlock NG let you block specific URLs in seconds and can schedule blocks for certain hours.
  • Your router's parental controls can block a website for everyone on your Wi-Fi, but you need to log into your router's settings page.
  • Windows and Mac both have built-in hosts file editing that blocks a URL system-wide, though this requires more technical steps.
  • Phone blocking requires either a third-party app or your phone's built-in screen time settings, depending on your device.
  • Blocking at the router level is hardest to bypass but requires you to remember your router's admin password.

Block a URL in your browser using an extension

This is the fastest method if you only need to block a site in one browser. Download a free extension like Freedom, Cold Turkey Blocker, or LeechBlock NG from your browser's extension store. These extensions let you add URLs to a blocklist and set times when the block is active.

To add a site: open the extension, click "Add site" or "Block list", paste the full URL (for example, reddit.com), and save. The next time you try to visit that URL in your browser, you'll see a blocking message instead. Most extensions let you set schedules — for instance, blocking the site only between 9 a.m. and 5 p.m. on weekdays.

The downside is that this only works in the browser where you installed the extension. If you use Chrome at work and Safari at home, you'd need to install the extension in both. Also, someone with access to your computer can disable the extension if they know your password.

Block a URL on Windows using the hosts file

Your computer has a file called the hosts file that tells your system where to send requests for certain web addresses. By editing this file, you can redirect a URL to a fake address so it never loads.

Open Notepad as administrator: press the Windows key, type "Notepad", right-click it, and select "Run as administrator". Then go to File > Open and navigate to C:\Windows\System32\drivers\etc. Select "All Files" from the dropdown at the bottom right so you can see the hosts file. Open it.

At the bottom of the file, add a new line with this format: 127.0.0.1 example.com (replace example.com with the site you want to block). Save the file. Now when you try to visit that URL, your computer will send the request nowhere and the page won't load. To unblock it later, delete that line and save again.

This method blocks the site across your entire computer, in any browser. However, it requires admin access and is easy to undo if someone else has your password.

Block a URL on Mac using the hosts file

Mac has the same hosts file system as Windows. Open Terminal (search for it in Spotlight), then type this command: sudo nano /etc/hosts and press Enter. You'll be asked for your password. Type it (you won't see the characters appear) and press Enter again.

The hosts file will open in the Terminal editor. Use the arrow keys to move to the bottom of the file. Add a new line with 127.0.0.1 example.com (replace example.com with the site you want to block). Press Control+X, then Y, then Enter to save and exit.

Like the Windows method, this blocks the site across your entire Mac in any browser. To unblock it, open Terminal again, run the same command, find the line you added, delete it, and save.

Block a URL at your router level

Blocking at your router affects everyone connected to your Wi-Fi. This is the strongest method because it stops the site from loading on any device — phone, laptop, tablet — before it even reaches that device.

Log into your router's settings page. Open a browser and type your router's IP address (usually 192.168.1.1 or 192.168.0.1) into the address bar. You'll be asked for a username and password — these are often "admin" and "admin" or "admin" and the password on a sticker on your router. If you've changed them and forgotten, you may need to reset the router.

Once logged in, look for a section called "Parental Controls", "Access Control", "URL Filtering", or "Blocked Sites" — the exact name varies by router brand. Add the URL you want to block. Save your changes. The router will now block that site for all devices on your network.

The downside is that this requires you to remember your router password, and it affects everyone on your Wi-Fi. If someone else knows the password, they can unblock the site.

Block a URL on iPhone or iPad

Apple's built-in Screen Time feature can block websites. Go to Settings > Screen Time > Content & Privacy Restrictions. Turn on "Content & Privacy Restrictions" if it's off. Then tap "Content Restrictions" > "Web Content" > "Restricted Websites".

Tap "Add a Website" and type the URL you want to block. You can add multiple sites. If you want to block all sites except a specific list, choose "Limit Adult Websites" instead and add sites to the "Always Allowed" section.

This method only works if you set a Screen Time passcode that you remember. If you forget the passcode, you'll need to reset your iPhone through your Apple ID.

Block a URL on Android

Android doesn't have a built-in URL blocker in the same way iOS does. Your best option is to use a third-party app like AppBlock, Freedom, or Digital Wellbeing (which comes pre-installed on many Android phones).

For Digital Wellbeing: go to Settings > Digital Wellbeing & parental controls > App timers or Bedtime mode. These tools let you set schedules for apps, but not specific websites. For website blocking, download AppBlock or Freedom from the Google Play Store, open it, add the URL to your blocklist, and set when you want it active.

Like browser extensions on a computer, these apps only block the site in the browser where they're active. They don't block the site system-wide the way a router block would.

Frequently Asked Questions

Can someone bypass a block I've set?

It depends on the method. Browser extensions and hosts file blocks are easy to undo if someone has your computer password. Router blocks are harder to bypass because they work before the request reaches the device, but anyone who knows your router password can disable them. Screen Time on phones can be bypassed if someone knows your passcode. Router blocking is the hardest to work around without the admin password.

Will blocking a URL at my router slow down my internet?

No. Blocking at the router level has no measurable impact on your internet speed. The router simply refuses to forward requests to blocked domains, which is a very fast operation.

What's the difference between blocking a URL and blocking a domain?

A domain is the main address (reddit.com), while a URL includes the full path (reddit.com/r/news). Most blocking tools work at the domain level, so blocking reddit.com blocks all pages on Reddit. If you want to block only one specific page, you'd need a browser extension that supports partial URL matching.

If I block a site on my router, can I unblock it just for my phone?

Not through the router itself. Router blocks apply to all devices. To unblock it for one device, you'd need to either remove the block from the router (which unblocks it for everyone) or use a VPN on that device to bypass the router block. Most routers don't have per-device blocking options.

Does blocking a URL prevent someone from accessing it on mobile data instead of Wi-Fi?

No. Router blocks only affect devices connected to your Wi-Fi. If someone uses their phone's cellular data instead, the router block won't stop them. To block a site on mobile data, you need to use a device-level method like Screen Time on iPhone or an app blocker on Android.