TL;DR
- If you use Chrome: install a blocking extension, add
onlyfans.comto its list yourself, and allow it in Incognito. The free HAJR Chrome extension does all three. - If you use more than one browser: add a system-wide block through the hosts file, so Safari, Edge, Firefox and Chrome are all covered. The steps for Mac and Windows are below.
- Remove browsers you do not need. Every extra browser is another thing to set up.
- Make it hard to undo. On a laptop you own, anything can be reversed eventually. The goal is to make reversing it slow, deliberate and, if you choose, visible to someone you trust.
This page is for laptops and desktops. For phones and the routes a site block misses, start at how to block OnlyFans on every device.
Option 1: block OnlyFans in Chrome
This is the fastest setup, and it is enough if Chrome is the only browser you use.
- Install the HAJR Chrome extension. It is free.
- Open the extension's settings and use Add Custom Domain to add
onlyfans.com. Addfansly.comand any similar site you might switch to. The block applies to any address containing the domain, so subdomains are covered too. - Allow it in Incognito. Chrome does not run extensions in Incognito windows unless you allow it. In Chrome, go to Extensions, open HAJR's Details, and turn on Allow in Incognito. HAJR's setup screen prompts for this, because without it Incognito is left open.
- Test it with a harmless site you have added for the purpose, in a normal window and in Incognito.
Add onlyfans.com yourself even though the extension blocks known adult sites automatically. Built-in lists vary in what they cover, and a site with non-explicit creators as well as explicit ones is exactly the kind a category list can miss.
Make it harder to switch off
An extension can be removed from Chrome in a few seconds. If that is the move you are likely to make, add someone to it.
HAJR's extension has optional accountability. You add a verified partner. Selected protection changes then need their approval, and they are notified if the extension is removed. They do not see your browsing. They see only the change.
The extension also blurs explicit images locally on your machine and can switch off short-form feeds (YouTube Shorts, Instagram Reels and TikTok on desktop). Those feeds are often how OnlyFans promotion reaches you in the first place.
Option 2: block OnlyFans in every browser
A browser extension only protects the browser it is installed in. To cover every browser on the laptop, block the domain at the system level with the hosts file. It is a small text file that tells the computer where to find websites, and it takes priority over normal lookups.
You will need your computer's administrator password.
On a Mac
- Open Terminal (in Applications, then Utilities).
- Type
sudo nano /etc/hostsand press Return. Enter your Mac password when asked. Nothing appears as you type it. - Use the arrow keys to go to the bottom of the file and add these lines:
0.0.0.0 onlyfans.com
0.0.0.0 www.onlyfans.com
0.0.0.0 fansly.com
0.0.0.0 www.fansly.com
- Press Control + O, then Return, to save. Press Control + X to exit.
- Clear the Mac's DNS cache so the change takes effect straight away:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - Quit and reopen your browsers.
On Windows
- Click Start, type Notepad, right-click it and choose Run as administrator. Opening Notepad normally will not let you save the file.
- In Notepad, choose File, then Open, and go to
C:\Windows\System32\drivers\etc. Change the file type from "Text documents" to All files, then open hosts. - Add the same lines at the bottom:
0.0.0.0 onlyfans.com
0.0.0.0 www.onlyfans.com
0.0.0.0 fansly.com
0.0.0.0 www.fansly.com
- Save and close. Restart your browsers.
If you would rather not edit a system file by hand, Microsoft's free PowerToys includes a Hosts File Editor that does the same thing through a simple interface.
What the hosts file does not do
The hosts file blocks only the exact addresses you list. It does not understand wildcards, so each subdomain needs its own line. It does not follow you to another computer. And anyone with the administrator password can remove the lines again.
Some browsers can also look up websites through their own secure DNS setting, which may not consult the hosts file in every configuration. After setting it up, test it in every browser you use. If one still loads your test site, turn off that browser's secure-DNS setting or remove the browser.
For Chrome, the extension from Option 1 still applies on top of the hosts file, and is the harder of the two to undo if you have added an accountability partner.
Close the other routes on a laptop
- Remove browsers you do not use. Fewer browsers means fewer places to set up and test.
- Sign out of OnlyFans and delete the saved password in your browser's password manager.
- Deal with the money. A block stops the page loading. It does not stop your subscriptions renewing. Cancel your subscriptions or delete the account.
- Move the laptop. If late nights in your room are when it happens, using the laptop only in a shared space is a block that takes no software.
Then do your phone
Most people who block a laptop and leave their phone open find the phone becomes the route instead. On iPhone, how to block OnlyFans on iPhone takes about five minutes. The HAJR app's one-click porn blocking covers every browser on the phone and blocks OnlyFans automatically, stays locked until your timer ends, and app uninstall protection keeps it from being deleted in a weak moment.
HAJR publishes this guide. The Chrome extension is free. The iPhone app is free to download and requires a subscription for full access.
Frequently asked questions
How do I block OnlyFans on Chrome?
Install a blocking extension such as HAJR's, add onlyfans.com to its custom list, and turn on Allow in Incognito in the extension's details. Without that last step, Incognito windows are not covered.
How do I block OnlyFans on a MacBook?
Add the domain to the hosts file (Option 2, Mac steps above) to cover every browser. If you use Chrome, add the HAJR extension as well.
How do I block OnlyFans on Windows?
Edit the hosts file as administrator, or use Microsoft PowerToys' Hosts File Editor, and add onlyfans.com and www.onlyfans.com. Test in every browser afterwards.
Can I block OnlyFans on a laptop without anyone knowing?
Yes. The hosts file and the HAJR extension both work without reporting to anyone. The extension's accountability partner is optional. Add one only if you want someone to approve changes.
Related reading
- How to block OnlyFans on every device
- Adult website blocker for Chrome
- OnlyFans addiction: signs and how to stop
Sources
- HAJR. HAJR Chrome extension on the Chrome Web Store.
- Microsoft Learn. Can't modify the Hosts or Lmhosts file. Updated February 2026. Hosts file location and the run-as-administrator workaround.
- Microsoft Learn. PowerToys Hosts File Editor utility for Windows.
- Chrome Web Store Help. Install and manage extensions. Includes the steps to allow an extension in Incognito.
