How to block X / Twitter on a Mac

Block x.com and twitter.com on a Mac with Screen Time, the hosts file, or Nudge focus sessions, and see which method works in Safari, Chrome and the X app.

App icons of Nudge, Apple Screen Time, SelfControl, Cold Turkey, Freedom

To block X on a Mac, block both x.com and twitter.com. The fastest built-in route is Screen Time, which covers Safari. The hosts file applies to browsers on this Mac that use the system resolver or Chrome's own resolver. A focus app like Nudge blocks the sites in Safari and Chrome during the sessions you choose. If you only use Safari, restrict both addresses in Screen Time. If you use Chrome or several browsers, edit the hosts file or use Nudge. Nudge is the better fit when you want X blocked during work and available afterwards.

How do these apps compare?

Block x.com and twitter.com on a Mac in the browsers you use, and choose between an always-on block and a block that runs only during work.

AppBest forPriceWebsite
NudgeTop pickBlocking X only while you work$9.99 onceGet Nudge
Apple Screen TimeA free Safari blockFree, built into macOSVisit
SelfControlFree hard website blocksFreeVisit
Cold TurkeyStrict locked blocksFree, Pro one-timeVisit
FreedomBlocking on Mac and phone$8.99/mo or $99.50 lifetimeVisit
BlockSiteA light browser extensionSee pricingVisit

Which tool should you pick?

Nudge

Blocks x.com, twitter.com and the X app during a session, in Safari and Chrome, and leaves them open afterwards.

Apple Screen Time

No install and no Terminal, but Apple documents it for Safari only.

SelfControl

A free Mac blocker whose block stays on until the timer ends.

Cold Turkey

Strong blocking modes for users who need high friction.

Freedom

The same blocklists on Mac and phone.

The apps in detail

  1. Nudge

    Best for: Blocking X only while you work

    $9.99 once
    Choose it if
    You want x.com, twitter.com and the X app blocked in Safari and Chrome for the length of a session, started from the menu bar or on a schedule.
    Skip it if
    You want an all-day block with no session to start.
    Download Nudge for macOS
  2. Apple Screen Time

    Best for: A free Safari block

    Free, built into macOS
    Choose it if
    You only use Safari and want a built-in block with no extra install.
    Skip it if
    You use Chrome or need a block that runs only during work. Anyone who can open your Screen Time settings can remove the entries unless you set a Screen Time passcode.
    Visit Apple Screen Time
  3. SelfControl

    Best for: Free hard website blocks

    Free
    Choose it if
    You want a free timed block that stays on until the timer ends.
    Skip it if
    You need app blocking, sync, or flexible exceptions.
    Visit SelfControl
  4. Cold Turkey

    Best for: Strict locked blocks

    Free, Pro one-time
    Choose it if
    You need strict blocks and hard-to-bypass modes.
    Skip it if
    You want a gentle session workflow.
    Visit Cold Turkey
  5. Freedom

    Best for: Blocking on Mac and phone

    $8.99/mo or $99.50 lifetime
    Choose it if
    X pulls you away on both your Mac and your phone.
    Skip it if
    You want a Mac-local session tool only.
    Visit Freedom
  6. BlockSite

    Best for: A light browser extension

    Choose it if
    You want lightweight browser-based controls.
    Skip it if
    You need system-level Mac app blocking.
    Visit BlockSite

Which method should you use to block X on a Mac?

Pick by browser and by how permanent you want the block to be. Every method below is reversible by you, so choose the one you will keep using. X has two addresses, x.com and twitter.com, and they are separate domains, so block both.

MethodEffortBrowsersEasy to undo?
Screen Time web restrictionsLowSafariEasy: anyone who can open your Screen Time settings can remove the entries unless you set a Screen Time passcode
Hosts fileHigh (Terminal)Chrome and other browsers on this Mac that use the system resolver. Safari too, unless iCloud Private Relay is on.Easy: one edit to the file reverses it
Browser extensionsLowOne browser at a timeEasy: disable the extension or switch browser
Nudge focus sessionLowSafari and Chrome, plus apps you pickBlocks last for the session you start; you choose presets and schedules

Can Screen Time block X on a Mac?

Yes, in Safari. Screen Time is built in, needs no Terminal, and restricts websites through Content & Privacy. Apple documents this for Safari, so plan on it covering Safari only and check Chrome yourself before relying on it. When you finish the steps, open x.com in Safari to confirm it is blocked, and in each other browser you use to see whether it is covered. To remove a site later, select it in the Restricted list and click the minus button. Anyone who can open your Screen Time settings can remove the entries unless you set a Screen Time passcode.

  1. Open the Apple menu, then System Settings.

  2. Click Screen Time in the sidebar (you may need to scroll) and turn it on if needed.

  3. Open Content & Privacy and turn it on.

  4. Open App Store, Media, Web, & Games.

  5. Under Safari, choose Limit Adult Websites and click Customize.

  6. Click + under the Restricted list, enter x.com, then repeat for twitter.com, and click Done.

How do you block X with the hosts file?

This applies to browsers on this Mac that use the system resolver or Chrome's own resolver, and needs Terminal and an admin password. The hosts file maps a domain to an address on your own Mac, so the site cannot load. It works per hostname, with no wildcards, so list each address you use. Chrome reads the hosts file itself, so Chrome's secure DNS setting does not bypass it.

  • Open tabs and cached connections can keep a site loading until the cache is flushed and the browser restarted.
  • A proxy or VPN that resolves names remotely does not read this Mac's hosts file.
  • With iCloud Private Relay on, Safari sends its web requests through Apple's relays, so a hosts entry may not apply there; turn Private Relay off for Safari, then open the site to confirm it is blocked.
  • To undo it later, open the file again, delete the four lines and flush DNS again.
  • It is a manual, all-day block, so it also blocks X when you might want it.
  1. Open the hosts file in Terminal.

    sudo nano /etc/hosts
  2. Add these lines at the bottom, then press Control-O, Return and Control-X to save and exit.

    127.0.0.1 x.com
    127.0.0.1 www.x.com
    127.0.0.1 twitter.com
    127.0.0.1 www.twitter.com
  3. Flush the DNS cache so the change applies now.

    sudo dscacheutil -flushcache
    sudo killall -HUP mDNSResponder
  4. Quit and reopen your browser, then open X to confirm it is blocked.

What browser-level options block X?

Safari and Chrome both support extensions that block websites, and each only protects the browser it is installed in. Open another browser and X loads. Chrome has no built-in per-site block in its settings, so an extension is the usual route there. Use them as a light nudge, not a firm rule.

For browser-specific steps, see how to block websites in Chrome on Mac and how to block websites in Safari on Mac.

How do you block X only during work sessions?

Use a focus session so X is blocked when you work and open when you do not. Nudge blocks the apps and websites you pick for the length of a focus session. Websites are blocked in Safari and Chrome. If an X app is installed on your Mac, you can add that app to the same preset.

  1. Open Nudge and create a preset, for example Deep Work.

  2. Add x.com and twitter.com to the websites to block.

  3. Add the X app if you have it installed.

  4. Start the preset from the menu bar, or use Quick Focus for a one-off session.

  5. Optionally, set a schedule so the preset runs on chosen days and hours.

How do you block X on an iPhone too?

Use Screen Time on the iPhone. Blocking on your Mac does not carry over to your phone, and Nudge is a Mac app, so phone blocking comes from Screen Time or another phone app.

  1. Open Settings, then Screen Time.

  2. To block the website, open Content & Privacy Restrictions (switch it on), then App Store, Media, Web, & Games, then Web Content, then Limit Adult Websites. Under Never Allow, tap Add Website and enter x.com, then twitter.com.

  3. To limit the X app, choose App Limits and add it.

  4. Set a Screen Time passcode so you cannot change the limit on impulse.

How do you keep X closed during work with Nudge?

Nudge is a free 7-day trial on every Mac with no email, password or card to start, then $9.99 once for Lifetime Access, with no subscription. Add x.com and twitter.com to a preset, start it from the menu bar, and X stays closed while you work and opens again when the session ends.

For a general overview, read how to block websites on Mac. Compare other tools in best website blocker apps for Mac. For the difference between blocking apps and blocking sites, read app blocker vs website blocker. A timer can help too: try the free Pomodoro timer.

FAQ

Does blocking twitter.com also block x.com?

No. They are separate domains, so block both. With the hosts file, add x.com, www.x.com, twitter.com and www.twitter.com. With Screen Time or Nudge, add both addresses to the list.

Does Screen Time block X in Chrome?

Apple's instructions for web content restrictions describe Safari. Do not count on them to cover Chrome. Chrome has no built-in per-site block in its settings, so for Chrome use the hosts file, an extension, or a focus app that blocks websites in Chrome. Open the site in Chrome to confirm it is blocked.

Can I block X on my Mac but still use it on my phone?

Yes. Every method on this page works per device. Blocking on the Mac does not change the iPhone, and the reverse is also true.

Is there an X app for Mac that I need to block separately?

Website blocks do not cover an installed app. If you have an X app on your Mac, add it as an app to block in Nudge, or remove it. Screen Time can also set limits on apps.

How do I undo a hosts file block?

Open /etc/hosts again with sudo nano /etc/hosts, delete the lines you added, save, and run the DNS flush commands again.

What is the easiest way to block Twitter only during work?

Use a focus session. In Nudge you add x.com and twitter.com to a preset, start the session from the menu bar or on a schedule, and the sites are blocked in Safari and Chrome only while it runs.

Turn the guide into a focus session

Pick the apps and websites that pull you away and start the session from the menu bar. They stay blocked until it ends. $9.99 once after 7 days free, no card to start.

Download for macOS
Nudge preset with its app list and blocked websites

Sources

How-toHow to block websites on a Mac (2026)How-toHow to block websites on a Mac in Chrome (2026)How-toHow to block websites in Safari on a Mac (2026)Website blockingBest website & app blockers for Mac in 2026Blocking strategyApp blocker vs website blocker for Mac: which do you need?Website blockingCold Turkey alternatives for Mac in 2026PomodoroPomodoro timer with website blocking: a Mac setup that actually helps