Block Facebook

This article teaches you how to prevent computer or phone users from accessing Facebook. To do so on computer or mobile alike, you must have access to an account with Administrator privileges or their equivalence.

Steps

Blocking on Windows

  1. Open the Start menu. You can do so either by clicking the Windows logo in the bottom-left corner of the screen, or by pressing the Win key.
  2. Type Notepad into the search bar. The search bar is at the bottom of the Start menu.
    • For Windows XP, you'll instead click All Programs and select Accessories to find Notepad.
  3. Right-click Notepad. It's a blue, notepad-shaped icon at the top of the Start menu window. Right-clicking it will invoke a drop-down menu.
  4. Click Run as administrator. This option will open Notepad using your Administrator privileges.
  5. Click Yes when prompted. Notepad will open at this point.
  6. Click File. It's in the top-left corner of the Notepad window.
  7. Click Open. You'll see this option toward the top of the "File" drop-down menu.
  8. Click the address bar. This is the white bar at the top of the "Open" window; it will say something like "My Computer > Desktop" here. Clicking the address bar will highlight everything in it.
  9. Navigate to the "hosts" file folder. To do so, you'll type C:/Windows/System32/drivers/etc in and press Enter. This address will take you to your computer's "etc" folder, from which you can change the file that dictates to which websites your computer can connect.
  10. Click the "Text Documents" bar. This should be in the lower-right side of the "Open" window; clicking it will invoke a drop-down menu.
  11. Click All Files. You should see several files appear in the window.
  12. Right-click the "hosts" file. Doing so will invoke a drop-down menu.
  13. Click Properties. It's near the bottom of the window.
  14. Click the Security tab. This option is in the top-right area of the window.
  15. Click Edit. It's in the middle of the window.
  16. Click the "Full Control" checkbox. This box allows you to edit and, ultimately, replace the "hosts" file, which is exactly what you'll be doing.
  17. Click Apply, then click Yes when prompted. Since editing system files carries a degree of risk, Windows will alert you to the potential ramifications of doing so here.
  18. Click OK twice. This will return you to the "Open" window.
  19. Click the "hosts" file, then click Open. This will open the "hosts" file in Notepad, allowing you to view (and edit) its contents.
  20. Scroll down to the bottom of the "hosts" file. You'll see two "localhost" lines of text here.
  21. Click below the last line of text. It will say "::1 localhost" or "127.0.0.1 localhost" at the bottom of the page; you'll need to place the mouse cursor directly below the last line on this page.
    • Be careful not to delete anything in the "hosts" file.
  22. Type in 127.0.0.1 www.facebook.com and press Enter. This line of text will prevent Facebook from being accessible on this PC.
    • You should also block www.m.facebook.com to prevent people from going to Facebook's mobile site. You'll do this on a line below the first Facebook address.
  23. Click File. It's in the top-left corner of the Notepad window.
  24. Click Save As. This is an option near the middle of the "File" drop-down menu.
  25. Click the "Text Documents" bar and select All Files. Doing so will bring up the "hosts" file again, among other files on this page.
  26. Click the "hosts" file. This will select it.
  27. Click Save, then click Yes when prompted. You should no longer be able to log into Facebook on any browser.

Blocking on Mac

  1. Open Spotlight. To do so, click the magnifying glass icon in the top-right side of your Mac's screen.
  2. Type terminal into Spotlight. This will bring up a list of programs, the top-most of which should be Terminal.
  3. Click the Terminal icon. It's a black screen with a white ">_" on it.
  4. Copy sudo nano /etc/hosts into Terminal. This code is all one line.
  5. Press Return. Doing so will run your copied command.
  6. Enter your Mac's password and press Return. This is the password you use to log into your Mac. As long as the password is correct, you'll be able to proceed.
    • Even though Terminal won't display the characters you type, it is registering them.
  7. Press the arrow to navigate to the bottom of the page. You want the blinking grey cursor to be below the last line of text here.
  8. Type in 127.0.0.1. This command redirects the site after it back to your machine, meaning that any site entered in conjunction with this command (e.g., Facebook) will not be able to access the Internet.
  9. Press Tab . The cursor will move to the right.
  10. Type in www.facebook.com. This will prevent Facebook from being accessible on your Mac.
  11. Press Return. Doing so will save your command and place the cursor on a new line.
    • You should also block the Facebook mobile site by entering 127.0.0.1 www.m.facebook.com on this line.
  12. Type sudo killall -HUP mDNSResponder in and press Return. This command will flush your Mac's DNS cache, which will prevent any opposing prior data from clashing with your new, no-Facebook commands.[1]

Blocking on iPhone

  1. Delete apps on which one can access Facebook. To do so, you'll tap and hold an app, then tap the X in its top-left corner and tap Delete when prompted. Apps you should delete include the following:
    • Facebook
    • Any web browser other than Safari (e.g., Chrome)
  2. Open your iPhone's Settings. It's a grey app with gears in it that you'll likely find on the Home Screen.
  3. Scroll down and tap General. This option is just below the bottom of the screen.
  4. Scroll down and tap Restrictions. It's in the middle of the page.
  5. Tap Enable Restrictions. It's at the top of the page. If you haven't yet enabled Restrictions, you'll be prompted to create a four-digit passcode.
    • If you already have Restrictions enabled on your iPhone, simply enter your Restrictions password here.
  6. Type in your preferred passcode twice. Make sure this is a code that you'll remember but that isn't easy to guess (e.g., it should differ from your iPhone's passcode).
    • Skip this step if you already have Restrictions enabled.
  7. Slide Safari left to the "Off" position. This option is at the top of the "ALLOW" group of apps and features. Disabling Safari effectively removes web browsing from the iPhone, making it impossible to access Facebook outside of the app.
    • Alternatively, you can keep this option enabled, then tap Websites in the "ALLOWED CONTENT" group of options, tap Specific Websites Only, and add any websites you wish to allow while ensuring that Facebook is not included.
  8. Slide Installing Apps left to the "Off" position. It's near the bottom of the screen. With this feature disabled, a user on this phone won't be able to re-download Facebook.
    • If your phone has a four-inch screen, you'll first need to scroll down to see this option.
  9. Scroll down and tap Facebook. It's in the "PRIVACY" group of options.
  10. Slide any apps listed here left to the "Off" position. Doing so will prevent any of these apps from using Facebook data.
  11. Tap Don't Allow Changes. It's toward the top of this page. This will prevent these apps from requesting Facebook data in the future. Facebook is now completely blocked on your iPhone.

Blocking on Android

  1. Open your Android's Settings. This grey, gear-shaped app is likely found in the App Drawer, which is a grid of two-by-three dots near the bottom of the screen.
  2. Scroll down and tap Users. It's an option below the "DEVICE" heading.
    • On some Samsung devices, you must first tap Device to view this option.
  3. Tap Add user or profile. This option is near the top of the page.
  4. Tap Restricted profile when prompted. Creating a restricted profile will allow you to moderate the apps and services the profile can access without having to relinquish your own apps.
    • If you don't currently have a passcode on your Android, first tap Set lock and follow the on-screen setup instructions for creating a passcode.
  5. Tap the "New profile" gear icon. It's next to the new profile listed here.
  6. Enter a name, then tap OK. This will create a name for your restricted account.
  7. Slide any apps you wish to enable right to the "On" position. Make sure you keep Facebook, Play Store, and any web browsers disabled.[2]
  8. Lock your Android device. The restricted profile will be immediately accessible without a passcode, though the restricted profile will also only be able to access the apps you've allowed.

Tips

  • You can also download browser-specific extensions that will allow you to block Facebook on one browser instead of the whole computer (e.g., "Block site" for Chrome).[3]

Warnings

  • When using Terminal or editing the "hosts" file in general, do not delete any information that is present in the original file. Doing so may permanently damage your computer's operating system.

Related Articles

Sources and Citations

You may like