How to Block a Website on Android and Windows 10?

In this post, we’ll see:

  • How to Block a Website on Windows 10
  • How to Block a Website on Android

Let us begin.

Read: How to Create Shortcut to Devices and Printers

How to Block a Website on Windows 10

Open Notepad as Administrator.

Hit on File > Open.

Go to this location in the pop-up: C: > Windows > system32 > drives > etc.

Now, choose All Files from the drop-down list above the Open button, and you can see the hosts file. Double-click it.

Now, at the end of the file, in a new line, type: 127.0.0.1 thewebsiteyouwanttoblock

Remember that you need to use the exact URL of the site. I want to block Facebook. So, I need to enter 127.0.0.1 www.facebook.com

I hope you got the point. Now, do the same for all the websites you want to block.

After that, hit File and then hit the Save.

To Unblock a Site

Remove the line regarding the site or comment the line by putting # at the front of it.

Read: How to Fix Access is Denied Error While Editing Hosts File

How to Block a Website on Android

You can do this in two diverse ways, and they are:

For Rooted and Non-Rooted Android Devices

Install and open the FocusMe app. Provide the permissions for the app.

Now, you can see the Plans screen. Tap the + icon at the bottom. Tap Next.

In the Enter Websites screen, add all the websites you want to block. Tap Next.

Tap Scheduled > Next.

Choose all days. Tap Next.

In the Set Daily Intervals screen, tap the + icon at the bottom. In the Focus From, set the time as 00:00. In the Focus Until, set the time as 23:59. Tap OK. Tap Next.

Leave the options intact. Tap Next.

In the Plan Name field, provide the name for this plan. Set Custom Password for both Active Stop Protection and Inactive Stop Protection. Tap Next.

In the Set Start Day screen, tap Next. Now, in the Set Last Day screen, tap No End Date option at the bottom.

That’s it. From now on, the websites you’ve specified in the app will be blocked.

If someone tries to access the blocked website, they will see a toast notification stating “FocusMe: Website ‘website URL’ is not allowed.”

Notes:

  • While testing, I’ve found that this app works perfectly on Chrome, Firefox, and Edge. Remember that this app also works perfectly on the private browsing mode of Chrome, Firefox, and Edge.
  • Also, keep in mind that you can edit the plan. To change the plan, first, you need to stop the plan (if it is active) and then tap on it. Now, you can see the Edit option at the bottom. Tap on it to edit the plan.

For Rooted Android Devices Only

Here’s how you can block websites on Android:

Install and open the ES File Explorer File Manager app.

Tap the three vertical lines at the top.

Tap Local > Device > etc folder. Find and tap the hosts file.

Select Text and then select ES Note Editor.

Tap three vertical dots at the top. You can see the Edit option. Tap on it.

Now, enter the website(s) you want to block like this:

‚Äč127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
127.0.0.1 m.facebook.com

Enter all the versions of the website(s) like above.

Hit the Back arrow at the top of the hosts file, and you can see the confirmation pop-up. Tap Yes.

Note:

If you’re facing the error, “Error occurred when trying to save the file. It will not be saved,” then follow the below steps:

Tap the three vertical lines at the top of the ES File Explorer.

Find and hit the Root Explorer option. Now, you can save the file without error.

Restart your mobile.

That’s all. From now on, the websites you’ve specified in the hosts file will be blocked.

Notes:

While testing, I see that this method works perfectly in Chrome and Firefox. The same is the case in their private mode, too.