Internet, Networking, & Security > Family Tech How to Block a Website Need to stay focused? Learn how to block distracting websites By Jason Bennett Jason Bennett Writer George Brown College Jay Bennett is a former Lifewire writer and digital marketing consultant with 8 years' experience. His writing has appeared on the VisiHow website. lifewire's editorial guidelines Updated on June 16, 2022 In This Article View All In This Article Block Websites in Windows Block Websites on a Mac Block Websites With a Browser Block Websites on Android Block Websites on iOS Block Websites With a Router Close 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. Enter notepad into Windows search, then right-click Notepad (Desktop app), and then select Run as administrator. Select Yes when the User Account Control window appears. If a UAC window doesn't appear, skip to the next step. Go to File, then select Open. 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. 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. Reboot your system, then open your preferred browser and attempt to visit the website or sites that you added to your Hosts file. Block Websites Using the Mac's Hosts File The steps below illustrate how to edit your Mac's Hosts file using Terminal. Launch a Finder window. Select Applications in the left pane. Double-click Utilities. Double-click on Terminal. Enter the command sudo nano /etc/hosts into Terminal, then press return. Enter your password (administrator), then press return. This will open the Nano text editor. 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. 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. Enter Chrome into Windows search, and select Google Chrome. Open the vertical ellipsis menu in the upper right corner, and then select More. tools > Extensions. Open the hamburger menu next to Extensions. Select Open Chrome Web Store. Enter block site into the search box, then select Enter. Select Add to Chrome next to Block Site - Website Blocker for Chrome™. Select Add extension. Select Agree. Enter the website you wish to block, then select the (+) icon. Open a new tab and attempt to visit the site or sites you just blocked. How to Block Websites With Firefox or Opera 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. Blocking Websites on Android The steps below show how to block websites using the Block Site mobile application. Go to Block Site's Play Store page, tap INSTALL, and then OPEN. Tap GO TO SETTINGS. Tap GOT IT. On the Accessibility screen, tap BlockSite. Tap the toggle switch to enable accessibility. Tap OK. Tap the (+) sign in the lower right corner. Enter the website address, then tap the checkmark in the upper right corner. All your blocked websites are below BLOCKED SITES AND APPS. Block a Website on iPhone and iPad The steps below who how to block websites on an iPhone or iPad, using Screen Time. Tap Settings, then tap Screen Time. Tap Turn On Screen Time. Tap Continue. Tap This is My iPhone, or This is My Child's iPhone. Tap Content & Privacy Restrictions. Tap Content & Privacy Restrictions to enable, then tap Content Restrictions. Tap Web Content. Tap Limit Adult Websites, and then Add Website. Enter a website address, and tap 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. Open a web browser, enter 192.168.2.1 into the address bar, then select Enter or Return.Enter your username and password if prompted.From your router's interface, select the privacy and security, restrictions, or blocking options.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? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Subscribe Tell us why! Other Not enough details Hard to understand Submit