How to Block a Website

Need to stay focused? Learn how to block distracting websites

The most efficient way to block a website depends primarily on the device and web browser you're using. For example, when running a desktop browser that supports extensions, such as Chrome, Firefox, or Opera, an add-on works great. If you're using a web browser that doesn't support extensions, such as Microsoft Edge, editing your Windows Hosts file will get the job done. The Hosts file on Windows and Mac is the only way to block all browsers from visiting specific websites. Blocking sites on Android phones and tablets with a mobile app is quite useful. For iPhone and iPad users, Screen Time provides a straightforward method for blocking specific websites. For parents or guardians who wish to shield their children from potentially harmful content, blocking sites directly via the router ads an additional layer of protection.

This article includes instructions for devices running: Windows 7/10, macOS, Android, and iOS.

A screenshot of Google Chrome visiting a blocked website.

Block Websites Using the Windows Hosts File

The steps below demonstrate how to edit the Hosts file in Windows 10 and 7.

  1. Enter notepad into Windows search, then right-click Notepad (Desktop app), and then select Run as administrator.

    Windows 10 searching for Notepad.
  2. Select Yes when the User Account Control window appears. If a UAC window doesn't appear, skip to the next step.

    Windows' UAC box.
  3. Go to File, then select Open.

    Notepad accessing the file menu.
  4. Navigate to C: > Windows > System32 > drivers > etc, choose the Hosts file, and then select Open. If you don't see the Hosts file, select All Files from the drop-down.

    Notepad opening Windows hosts file
  5. Add a line to the Hosts file by placing the cursor at the end of the last line, then press Enter or Return. Enter in the line you just created (below the last line). Repeat for each website you wish to block, keeping every web address on its own line, then go to File and select Save.

    Notepad saving a file.
  6. Reboot your system, then open your preferred browser and attempt to visit the website or sites that you added to your Hosts file.

    A screenshot of Firefox attempting to visit a blocked website.

Block Websites Using the Mac's Hosts File

The steps below illustrate how to edit your Mac's Hosts file using Terminal.

  1. Launch a Finder window.

  2. Select Applications in the left pane.

    Selecting Applications in Finder.
  3. Double-click Utilities.

    Opening Utilities.
  4. Double-click on Terminal.

    Opening Terminal.
  5. Enter the command sudo nano /etc/hosts into Terminal, then press return.

    Entering in a command in Terminal.
  6. Enter your password (administrator), then press return. This will open the Nano text editor.

    Terminal prompting for a password.
  7. Move the cursor below the last line, enter, then press return. Repeat this for each website you wish to block.

    Entering in a website into Nano.
  8. Press Ctrl + O to save the file, then press Ctrl + X to exit the Nano text editor.

Block Websites With Your Browser

Block a Website in Google Chrome

The steps below show how to block websites using the Block Site extension for Google Chrome. If you're using Mac or Linux, launch Chrome, and go to the second step.

  1. Enter Chrome into Windows search, and select Google Chrome.

    Windows searching for Google Chrome.
  2. Open the vertical ellipsis menu in the upper right corner, and then select More. tools > Extensions.

    Chrome's main menu.
  3. Open the hamburger menu next to Extensions.

    Chrome's installed extensions.
  4. Select Open Chrome Web Store.

    Chrome's Extension menu.
  5. Enter block site into the search box, then select Enter.

    Chrome web store.
  6. Select Add to Chrome next to Block Site - Website Blocker for Chrome™.

    Chrome showing extension search results.
  7. Select Add extension.

    Adding an extension to Chrome.
  8. Select Agree.

    BlockSite's disclaimer.
  9. Enter the website you wish to block, then select the (+) icon.

    adding website addresses to BlockSite's block list.
  10. Open a new tab and attempt to visit the site or sites you just blocked.

    A screenshot BlockSite blocking access to a website.

How to Block Websites With Firefox, Opera, and Internet Explorer

  • Firefox Quantum: Install the uBlock Origin web extension found on Mozzila's Add-on site, then add the websites you wish to block via the dashboard.
  • Opera: Install Block Site from Opera's Add-on site, then add domains you wish to block from options.
  • Internet Explorer: Enter the website address for each site you want to block from the privacy tab via settings.

Microsoft no longer supports Internet Explorer and recommends that you update to the newer Edge browser. Head to their site to download the newest version.

Blocking Websites on Android

The steps below show how to block websites using the Block Site mobile application.

  1. Go to Block Site's Play Store page, tap INSTALL, and then OPEN.


  3. Tap GOT IT.

    installation of Block Site for Android.
  4. On the Accessibility screen, tap BlockSite.

  5. Tap the toggle switch to enable accessibility.

  6. Tap OK.

    enable accessibility for Block Site.
  7. Tap the (+) sign in the lower right corner.

  8. Enter the website address, then tap the checkmark in the upper right corner.

  9. All your blocked websites are below BLOCKED SITES AND APPS.

    block a site with BlockSite.

Block a Website on iPhone and iPad

The steps below who how to block websites on an iPhone or iPad, using Screen Time.

  1. Tap Settings, then tap Screen Time.

  2. Tap Turn On Screen Time.

  3. Tap Continue.

    enable Screen Time on an iPhone or iPad.
  4. Tap This is My iPhone, or This is My Child's iPhone.

  5. Tap Content & Privacy Restrictions.

  6. Tap Content & Privacy Restrictions to enable, then tap Content Restrictions.

    enable content and privacy restrictions in Screen Time.
  7. Tap Web Content.

  8. Tap Limit Adult Websites, and then Add Website.

  9. Enter a website address, and tap Done.

    add a website address to restricted web content on iPhone and iPad.

Use Router Settings to Block Websites

The steps below generally outline how to block websites using your router. Because every router is different, the steps will vary slightly. In most cases, you'll need the username and password associated with your ISP account, as well as the administrative password for your router or modem. To connect with your router you'll need to access its control screen. Unfortunately, each router manufacturer does this differently, but we have an article on helping you find your router's IP address. We'll use a Belkin router in our example below.

  1. Open a web browser, enter into the address bar, then select Enter or Return.
  2. Enter your username and password if prompted.
  3. From your router's interface, select the privacy and security, restrictions, or blocking options.
  4. Enter the websites you want to restrict access to and save or apply the changes. If prompted, enter your username and password to save the changes.

If you intend to stay away from distracting websites, you can use a browser extension, your Hosts file (Windows and Mac), a mobile app (Android), or Screen Time (iOS). If your objective is to restrict children from accessing certain websites, blocking using your router or modem is the best method.

Was this page helpful?