The basic structure of a habit is cue → craving → response → reward:
The cue is the context that triggers the habit, such as feeling bored or anxious.
The craving is the feeling that you should take some action, such as reaching for your phone and opening up YouTube.
The response is the action, such as watching a video.
The reward is the result that reinforces the habit, such as the dopamine hit of novel content.
Weaken these four and the habit eventually fades. For example, if your phone is harder to reach, it'll be more difficult to act on the habit.
But since this is ostensibly a tech blog, here are some tech things you can do with the same effect:
/etc/hosts file defines redirects for different websites.
Redirecting a website to
localhost (IP address
127.0.0.1), as is done here,
has the effect of preventing you from visiting that website:
1 2 3 4 5 6 7 8 9 10
www is necessary if the site uses it.
If these changes don't take effect, run:
to flush the cache.
[iOS] Enable Content & Privacy Restrictions
Update — This doesn't work well. iOS allows block lists only as part of their "Limit Adult Websites" feature, which has false positives and can block legitimate sites based on keywords.
If you have an iOS device, you can also enable per-website restrictions:
- Go to Content & Privacy Restrictions in Settings.
- Go to Content Restrictions → Web Content.
- Select Limit Adult Websites (sketchy name, I know).
- Add whatever websites you want to block to the Never Allow list.
Does this work?
These changes are just speed bumps I use to remind myself that I probably don't want to be using this website. If I have a real need, I can easily circumvent these changes and use them when I need to.
If your problem is more serious, I've heard good things about Freedom, but I think someone could circumvent basically any content blocker if they were determined enough.
This post was written in ... 18 minutes?! Wow, I need to learn to be faster.