Block access to Facebook, Instagram and Whatsapp

Here’s how you can ban Facebook and Instagram from your computer on a Windows 10 PC. The code below also blocks Whatsapp.

Blocking Facebook and Instagram requires you to modify the hosts file deep in your Windows folder.

Windows 10 Notepad Run as Administrator

First, click on the Windows start menu button and search Notepad. Once you see it, right click on the app and click “Run as Administrator.” There will be another pop-up asking you if you want to allow Notepad to make changes – agree to it. This is necessary in order to rewrite the hosts file, which is a protected file.

Click File > Open and navigate to C:\Windows\System32\drivers\etc

It’ll be blank because Notepad is only looking for .txt files (text files). On the drop-down menu at the bottom right corner, click it and choose “All Files”.

You should see a hosts file. The host file has no extension and should be a white icon. Click that and open.

Now to paste the routes that allow you to block Facebook and Instagram. Go to the very last line, create a new line and paste the code below, and save.

To unblock Facebook, just remove the code above. You might want to leave some empty lines to demarcate where this block of code is.

Once you have blocked Facebook, you won’t be able to access it on the computer where you have made the change. Nor will Instagram be such a distraction anymore because you can’t access it.

But you can still access it on your phone or on other devices.

I have found that doing this really increased my productivity. I find that every time I hit the wall while writing code or making art in Photoshop that I will just head to Facebook or Instagram.

They’re big content giants so they are always full of entertainment.

The problem is that this means that I can sometimes go down a rabbit hole of time wasting. So I looked up how to ban Facebook from my computer. Just blocking it from my computer will probably give me a 5-10% improvement on productivity.

Indeed, now that Facebook cannot be accessed, I find myself a bit aghast at the number of times I try to access it. It becomes much more obvious how many times I’m viewing it because I see the error screen that Firefox or Chrome displays when it can’t access a link.

Facebook and Instagram is still there but the hosts files reroutes the URLs to nowhere, and that’s why browsers think it’s a broken link.

It’s great to get rid of Facebook and Instagram and I recommend everyone gives it a try. You’ll be surprised how removing access to this on one device can improve your productivity.

I could have written a script in Node.js to do this automatically since I am a big fan of automating everything. But then I realized that if I wrote a script that made it easy to turn on and off access to Facebook and Instagram that it would defeat the purpose of this!

Making it tough to access social media essentially makes it hard to waste time.

Have a project in mind?

Websites. Graphics. SEO-oriented content.

I can get your next project off the ground.

See how I have helped my clients.