How to Block a Website

Need to stay focused? Learn how to block distracting websites

A screenshot of Google Chrome visiting a blocked website.

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.

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.

    A screenshot of 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.

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

    A screenshot of 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.

    A screenshot of 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 127.0.0.1 www.nameofsite.com 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.

    A screenshot of 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.
  7. You're done!

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.

  3. Double-click Utilities.

  4. Double-click on Terminal.

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

  6. Enter your password (administrator), then press return. This will open the Nano text editor.

  7. Move the cursor below the last line, enter 127.0.0.1 www.sitename.com, then press return. Repeat this for each website you wish to block.

  8. Press Ctrl + O to save the file, then press Ctrl + X to exit the Nano text editor.

  9. That's it!

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.

    A screenshot of Windows searhing for Notepad.
  2. Open the vertical ellipsis menu in the upper right corner, and then select More. tools > Extensions.

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

    A screenshot of Chrome's installed extensions.
  4. Select Open Chrome Web Store.

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

    A screenshot of the Chrom web store.
  6. Select Add to Chrome next to Block Site - Website Blocker for Chrome™.

    A screenshot in Chrome showing extension search results.
  7. Select Add extension.

    A screenshot adding an extension to Chrome.
  8. Select Agree.

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

    A screenshot 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.
  11. That's it!

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.

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.

  2. Tap GO TO SETTINGS.

  3. Tap GOT IT.

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

  5. Tap the toggle switch to enable accessibility.

  6. Tap OK.

    Three screenshots showing how to 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.

    Three screenshots showing how to block a site with BlockSite.
  10. That's it!

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.

    Three screenshots showing how to access and 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.

    Three Screenshots showing how to 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.

    Three Screenshots showing how to add a website address to restricted web content on iPhone and iPad.
  10. You're done!

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 192.168.2.1 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.