How to Block a Website in all Web Browsers



Community Tested

Why choose wikiHow?
When you see the green checkmark on a wikiHow article, you know that the article has received careful review. In this case, we tested the instructions on our own devices and confirmed that the instructions worked.

How to Block a Website in All Web Browsers

Four Methods:

This wikiHow teaches you how to prevent a specific website from being accessed on any browser on a Windows or Mac computer by editing the "hosts" file. Additionally, you can block sites on an iPhone or iPad using the Restrictions menu in the Settings, and Android users can use the free BlockSite app to restrict website and app access.

Steps

On Windows

  1. Open the Start menu .Click the Windows logo in the bottom-left corner of the screen or press the key.
    • On Windows 8, you must hover your cursor in the top-right corner of the screen and then click the magnifying glass icon.
  2. TypeNotepadinto Start.Doing so will display the Notepad app at the top of the Start menu window.
  3. Right-click onNotepadand selectRun as administrator.This option will open Notepad using your administrator privileges. If you don't open Notepad in administrator mode, you won't be able to edit the "hosts" file.
    • On a laptop with a trackpad instead of a traditional mouse, use two fingers to tap the trackpad instead of right-clicking.
  4. Click when prompted.Doing so will confirm your decision and open Notepad.
  5. Click , then clickOpen….You'll findOpenin theFiledrop-down menu.
  6. Go to the Hosts file's folder.In the window that opens after clickingOpen..., do the following:
    • Click theThis PCtab on the left side of the window.
    • Double-click your computer's hard drive (e.g.,OS (C:)).
    • Double-click theWindowsfolder.
    • Scroll down and double-click theSystem32folder.
    • Scroll down and double-click thedriversfolder.
    • Double-click theetcfolder.
  7. Show all file types.Click the "Text Documents" drop-down box near the bottom of the window, then clickAll Filesin the drop-down menu. You should see several files appear in the window.
  8. Allow editing for the "hosts" file.Right-click the "hosts" file, then do the following:
    • ClickProperties
    • ClickSecurity
    • ClickEdit
    • Check the "Full Control" box.
    • ClickOK, then clickYeswhen prompted.
    • ClickOKto exit the Properties window.
  9. Double-click the "hosts" file.This will open the "hosts" file in Notepad, allowing you to view and edit its contents.
  10. Scroll down to the bottom of the "hosts" file.You'll see two "localhost" lines of text here.
  11. Click below the last line of text.It will say either "::1 localhost" or "127.0.0.1 localhost" at the bottom of the page. Your cursor must be directly below the last line of text on this page.
    • Be careful not to delete anything that is already in the hosts file.
  12. Type in127.0.0.1and press .This is the loopback address to your own computer, which is what will return an error page in your web browser when someone tries to visit the blocked site.
  13. Type the address of the site you want to block.For example, if you wanted to block Google, you would typewww.google.com.
    • If you're blocking sites on Google Chrome, you'll need to place a space and then the "www.[site].com" version of the website's address after the "[site].com" version. To block Facebook, for example, you would type in127.0.0.1 facebook.com www.facebook.com.
  14. PressEnter.This moves your cursor to a new line. The code you entered will tell your computer to redirect the website to your loopback address instead.
    • You can add as many sites as you want to block, one per line, using the same number (127.0.0.1) as before.
    • If you want to be as thorough as possible, enter different variations of the address (e.g., "google.com" and "https://www.google.com/") as well.
  15. Save the Hosts file.Your changes won't be saved if you simply save usingFile>Save, so do the following to confirm your changes:
    • ClickFile
    • ClickSave As...
    • ClickText Documents, then clickAll Filesin the drop-down menu.
    • Click the "hosts" file.
    • ClickSave
    • ClickYeswhen prompted.

On Mac

  1. Open Spotlight .Click the magnifying glass icon in the top-right side of your Mac's screen.
  2. Typeterminalinto Spotlight.This will prompt Terminal to appear at the top of the search results.
  3. Double-click the Terminal icon .
  4. Open the Hosts file.Type the following code into Terminal and pressReturn:

    sudo nano /etc/hosts

  5. Enter your Mac's password when prompted.Type in the password that you use to log into your Mac, then pressReturn.
    • Terminal won't display the password characters as you type them.
  6. Move the blinking cursor down to the bottom of the page.To do so, press the key until the cursor is below the last line of text on the page.
  7. Enter the local host address.Type127.0.0.1into the blank line. This is the loopback address to your own computer.
  8. Press .The cursor will move to the right.
    • Don't pressReturnyet.
  9. Type the address of the site you want to block.For example, if you wanted to block Google, you would typewww.google.com.
    • This line would then read127.0.0.1 www.google.com.
    • If you want to be as thorough as possible, enter different variations of the address (e.g., "google.com" and "https://www.google.com/") as well.
    • If you're blocking sites on Google Chrome, you'll need to place a space and then the "www.[site].com" version of the website's address after the "[site].com" version. To block Facebook, for example, you would type in127.0.0.1 facebook.com www.facebook.com.
  10. PressReturn.This will tell your computer to redirect the website to your loopback address instead.
    • You can add as many sites as you want to block, one per line, using the same number (127.0.0.1) as before.
  11. PressControl+X.This is the command to exit the hosts file in the text editor. It will prompt you if you'd like to save your changes.
  12. Press to save your changes.It will then ask you what filename you'd like to save it as. You want to overwrite the original hosts file, so don't change the filename.
  13. PressReturn.This will save your changes to the original hosts file. Doing so exits the text editor and returns you to the main Terminal window. The website you added will now be unreachable in any web browser on the computer.

On iPhone

  1. Open your iPhone's Settings .It's a grey app with gears on it. You'll likely find Settings on the Home Screen.
  2. Scroll down and tapGeneral.This option is near the bottom of the screen (iPhone) or in the upper-left side of the screen (iPad).
  3. Scroll down and tapRestrictions.It's near the middle of the General page.
  4. Enter your restrictions passcode.This is the passcode you used to enable restrictions on your iPhone or iPad.
    • If you haven't yet enabled restrictions, first tapEnable Restrictions, then enter your desired passcode twice.
  5. Scroll down and tapWebsites.It's the last entry beneath the "ALLOWED CONTENT" heading.
  6. TapLimit Adult Content.You'll see a blue checkmark appear to the right of this option.
  7. TapAdd a Websitebelow the "NEVER ALLOW" heading.This is the last option on the page.
  8. Type in the web address of the website you wish to block. The address must start with "www" and end with a domain tag (e.g., ".com" or ".net"), but you can leave the "https://" section out if applicable.
    • For example, if you wanted to block Facebook on your iPhone or iPad, you would type inwww.facebook.com.
  9. Tap .It's the blue button in the bottom-right corner of the keypad. Your selected site is now inaccessible in the Safari browser.
    • This setting also applies to other popular mobile browsers such as Chrome and Firefox.

On Android

  1. Download the BlockSite app.BlockSite is an app which allows you to block websites and apps from being used on your Android. Open the Google Play Storeand do the following:
    • Tap the search bar.
    • Type inblocksiteand tap the "Search" button.
    • TapINSTALLbelow the "BlockSite - Block Distracting Apps and Sites" heading.
    • TapACCEPTwhen prompted.
  2. Open Block Site.TapOPENin the Google Play Store, or tap the shield-shaped Block Site app icon in your Android's App Drawer.
  3. TapENABLE.It's a green button at the bottom of the screen.
  4. TapGOT ITwhen prompted.Doing so should open your Android's Accessibility menu in the Settings app, but if it doesn't, do the following before proceeding:
    • OpenSettings
    • Scroll down and tapAccessibility
  5. Enable Block Site in your Android's Settings.Do the following in the Accessibility menu:
    • TapBlockSite
    • Tap the grey "BlockSite" switch .
  6. Re-open Block Site.If Block Site closed or minimized, bring it back up before proceeding.
  7. Tap .It's in the bottom-right corner of the screen. Doing so will take you to the page from which you can block websites.
  8. Enter a website's address.Tap the text field at the top of the screen, then type in the address of a website (e.g.,facebook.com).
  9. Tap .It's in the top-right corner of the screen. This will add the website to Block Site's list of blocked sites, which will prevent you from being able to visit the site in Google Chrome.
    • You can unblock this website at any time by tapping the trash icon to the right of its name.
  10. Block an entire app on your Android.If you have to temporarily block an app, you can do so by tappingin the bottom-right corner of the Block Site screen, tappingAPPS, and tapping an app's name.
    • Like websites, you can unblock the app at any time by tapping the trash icon to the right of its name.
  11. Block adult content on your Android if needed.If you're looking to prevent a child or similar from visiting adult sites or viewing restricted content, for more adult content-specific instruction.

Community Q&A

Search
  • Question
    How can I block a website on the iPad?
    wikiHow Contributor
    Community Answer
    Parental controls in the Settings app allows you to block websites with a passcode.
    Thanks!
  • Question
    I'm trying to block a virus on my dad's old Mac and I have no idea what his password is. He doesn't know his own password. Is there any other way to block the virus website that keeps popping up?
    wikiHow Contributor
    Community Answer
    Use a backup file that was prior to the virus. Ask your father if he remembers any of his passwords. If there is a pattern, maybe you can make a few educated guesses.
    Thanks!
  • Question
    Can this be reversible?
    wikiHow Contributor
    Community Answer
    Yes, it is a reversible process. Just remove the extra lines you added. Alternatively, you can restore the hosts file from a backup.
    Thanks!
  • Question
    How do I force the host file to open in a text editor?
    wikiHow Contributor
    Community Answer
    It can't be forced to open in a text editor, because it doesn't have the extension. To open, double-click the file and select the proper program to open it.
    Thanks!
  • Question
    How do I block a website on iPhone 6?
    wikiHow Contributor
    Community Answer
    Go into Settings > General > Restrictions and tap "Enable Restrictions." From there, you will be prompted to choose a pass code and indicate what websites you would like to block.
    Thanks!
  • Question
    How do I block a website on a Mac?
    wikiHow Contributor
    Community Answer
    You can't block one website without blocking all websites on Mac.
    Thanks!
Unanswered Questions
  • How do I block a specific website from my browser on my phone?
  • Can I add a keyword instead of a full website address?
  • I can't block on this method?
  • How can I save host files when blocked on Facebook?
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
  • You should flush your computer's DNS cache after editing the "hosts" file in order to prevent conflicts between the "hosts" file and your browser.
  • To unblock a site from the "hosts" file, simply open the file again and delete the lines that you added.Make sure you save your changes after removing the lines you added or the sites will still be blocked.
  • Your iPhone's Restrictions settings will apply to both Safari and other browsers as well.

Warnings

  • The Hosts file won't always work to block websites. You might want to try instead of using the Hosts file if the Hosts file isn't working.

Related wikiHows

Article Info

Categories:

In other languages:

Español: , Deutsch: , Português: , Italiano: , Français: , 中文: , Русский: , Bahasa Indonesia: , Nederlands: , العربية: , ไทย: , Tiếng Việt: , हिन्दी: 

Thanks to all authors for creating a page that has been read 1,674,306 times.
Is this article up to date?
Tested By:
wikiHow Technology Team

of How to Block a Website in All Web Browsers was reviewed on May 8, 2019.

How helpful is this?
Co-authors:
Updated:
Views: 1,674,306

Gus Doyle

Feb 15, 2019

"Great help, very effective on Windows 10 and Vista. I love the reason you cite at the beginning of the article. I'mamazed at how many people are surprised, or even hostile, when you want to block porn sites for yourself. Anyway, many thanks for the article."

Lee Brown

May 22, 2019

"Helped me to block web pages popping up as (unwanted) ads, whilst I was using unrelated sites of my own interest. "
Rated this article:

parth dev bundela

Dec 9, 2019

"Thank you so much.





Video: How To Block All The Websites Except Few

How to Block a Website in All Web Browsers
How to Block a Website in All Web Browsers images

2019 year
2019 year - How to Block a Website in All Web Browsers pictures

How to Block a Website in All Web Browsers forecast
How to Block a Website in All Web Browsers recommendations photo

How to Block a Website in All Web Browsers pictures
How to Block a Website in All Web Browsers foto

How to Block a Website in All Web Browsers How to Block a Website in All Web Browsers new photo
How to Block a Website in All Web Browsers new pictures

pics How to Block a Website in All Web Browsers
pictures How to Block a Website in All Web Browsers

Watch How to Block a Website in All Web Browsers video
Watch How to Block a Website in All Web Browsers video

Forum on this topic: How to Block a Website in All , how-to-block-a-website-in-all/
Communication on this topic: How to Block a Website in All , how-to-block-a-website-in-all/ , how-to-block-a-website-in-all/

Related News


How to Raffle on Facebook
15 Jumpsuits That Make Getting Dressed a No-Brainer
Diagnosing Arthritis: The Physical Exam
And the first celebrity baby of 2019 is
How to Get Your Blog Indexed by Google in 24 Hours
Food Diary: Here’s What Fitspo Sensation Kayla Itsines AteToday
13 Best Home Remedies To Treat Summer Cold
Study Says Your Trendy Open Office Is Bad For Productivity
Adderall Misuse May Be Hidden Part of Teen Amphetamine Abuse
Holiday Cinnamon Rolls
How to Become a Music Producer
How to Manage Emotional Eating on the Volumetrics Diet
Bolbove Pet Pumpkin Costume



Date: 12.12.2018, 08:17 / Views: 81142