How to block X (Twitter) on Windows

Sameed Ahmad
By Sameed Ahmad, who builds Focus AI (so read the Focus AI parts with that in mind).
Updated December 2026

To block X (Twitter) on Windows 10 or Windows 11, choose between three proven methods: editing C:\Windows\System32\drivers\etc\hosts as Administrator followed by ipconfig /flushdns (free across Chrome, Edge, and Firefox), configuring Microsoft Family Safety for a child's Windows login (great for blocking both sites and Windows desktop apps), or installing Focus AI inside Chrome, Microsoft Edge, Brave, or Firefox. Adding x.com, www.x.com, mobile.x.com, twitter.com, www.twitter.com, mobile.twitter.com, t.co to the Windows hosts file stops X (Twitter) system-wide without extra software, though anyone with Windows Administrator rights can delete those lines in seconds. For adults, remote workers, and parents on Windows, Focus AI adds Always-On Site Blocker (up to 3 sites free, unlimited Pro), Quit Wall strict mode, and Friend/Parent Passcode Lock.

1. Block X (Twitter) on Windows 10 & 11 via the hosts file (free)

  1. Open the Windows Start Menu, search for Notepad, right-click it, and click Run as administrator.
  2. Click File > Open, navigate to C:\Windows\System32\drivers\etc\, change the bottom-right dropdown from Text Documents (*.txt) to All Files (*.*), and open hosts.
  3. Paste the exact 127.0.0.1 and ::1 lines for X (Twitter) shown below at the bottom of the file, then press Ctrl + S to save.
  4. Open Command Prompt and run ipconfig /flushdns, then close and reopen Chrome, Edge, or Firefox.

2. Block X (Twitter) on Windows for kids with Microsoft Family Safety

  1. Ensure your child signs into Windows with a Standard (non-Administrator) Microsoft child account.
  2. Sign in at family.microsoft.com from your parent account, select the child, and open Content filters > Web and search.
  3. Enable web filtering, add x.com under Blocked sites, and block unmonitored browsers or desktop game launchers under Apps and games.

3. Block X (Twitter) on Windows Chrome, Edge, Brave, or Firefox with Focus AI

  1. Install Focus AI from the Chrome Web Store (works natively in both Chrome and Microsoft Edge) or Mozilla Add-ons (Firefox).
  2. Enable Allow in Incognito (Chrome) or Allow in InPrivate (Edge) inside your browser's extensions page.
  3. Add x.com to Always-On Site Blocker (free for up to 3 sites) or run context-aware AI focus sessions, with optional Friend/Parent Passcode Lock on Pro.

Exact X (Twitter) domains & subdomains (hosts file block)

Because X migrated from twitter.com to x.com while maintaining redirects and t.co link wrappers, half the manual lists online miss one of the domains. Blocking all 7 hostnames (x.com, www.x.com, mobile.x.com, twitter.com, www.twitter.com, mobile.twitter.com, t.co) in IPv4 and IPv6 closes the redirect leak.

127.0.0.1 x.com
::1 x.com
127.0.0.1 www.x.com
::1 www.x.com
127.0.0.1 mobile.x.com
::1 mobile.x.com
127.0.0.1 twitter.com
::1 twitter.com
127.0.0.1 www.twitter.com
::1 www.twitter.com
127.0.0.1 mobile.twitter.com
::1 mobile.twitter.com
127.0.0.1 t.co
::1 t.co
Need multiple sites? Open the free Hosts File Website Blocker Generator →
Interactive Demo · Zero Install

Try Focus AI live against X (Twitter)

Pick or type a real work task, then test any URL to see what stays open and what gets blocked.

x.com

X (Twitter) (social feed) does not serve "Building Next.js app".

BLOCKED
Session check log for “Building Next.js app”
Simulated client-side demo. In Chrome, Focus AI runs live on every tab during active sessions.Add Focus AI to Chrome
Windows loopholes & reality check

What breaks X (Twitter) blocks on Windows

On Windows 10 & 11, watch two common bypasses: Microsoft Family Safety's native web filter only filters Microsoft Edge unless you also block Chrome and Firefox under Family Safety App Limits, and Chrome/Edge Secure DNS (DoH) can ignore your Windows hosts file until Secure DNS is turned off.

Windows hosts note: list both x.com and twitter.com in C:\Windows\System32\drivers\etc\hosts and run ipconfig /flushdns; also check Chrome/Edge Secure DNS settings if x.com still resolves.

X is the easiest feed for founders, engineers, and knowledge workers to disguise as 'staying informed.' The For You algorithm elevates outrage and hot takes because arguments drive replies, turning a 90-second industry check into 45 minutes of fragmented attention.

Privacy & pricing: Focus AI checks only the URL and brief page snippet during active sessions. Banking, login, email, and form inputs are skipped. Nothing is stored as browsing history or sold. Free for 3 AI focus sessions and up to 3 always-blocked sites, then $4.99/week, $14.99/month, or $79/year (save 56%).
FUTURE YOU IS WATCHINGLOCK IN

Block X (Twitter) on Windows and keep it blocked

Start free with 3 AI focus sessions and up to 3 always-blocked sites. Upgrade anytime for Friend/Parent Passcode Lock and unlimited protection.

Add Focus AI to Chrome
Free for 3 AI focus sessions + 3 always-blocked sites · 30-second setup · No account needed

Frequently asked questions

Why does Windows block me from saving the hosts file for X (Twitter)?

You must open Notepad via Right-Click > Run as administrator. If saving still fails, check whether your antivirus software temporarily locks C:\Windows\System32\drivers\etc\hosts against edits.

Does Microsoft Family Safety block X (Twitter) in Chrome on Windows?

No. Microsoft Family Safety web filtering enforces natively in Microsoft Edge only. Either restrict Chrome under Family Safety App limits, or install Focus AI with Parent Passcode Lock inside Chrome.

Does Focus AI work on Microsoft Edge on Windows 11?

Yes. Microsoft Edge supports Chrome Web Store extensions natively, so Focus AI runs on Edge with full Always-On Site Blocker, AI sessions, and Passcode Lock support.

More ways to block X (Twitter) & Windows guides