Block comments on the web
Comments on the web can be toxic, and a waste of time. Here's how to block them ...
In Firefox/Chrome, and Android #
I assume you already use uBlock Origin, and if not, then throw away whatever alternative you have, and switch to it.
On Android, uBlock Origin is supported by Firefox. If Firefox isn’t an option, there are others. At the moment of writing Vivaldi has backed-in content blocking, and supports custom filtering rules, but you might have to publish these rules, in a text file, somewhere online. Adguard might also support custom content filtering rules, although I have issues with trusting them MITM my traffic.
In uBlock Origin, add these to “My Filters” in its dashboard:
news.ycombinator.com##table.comment-tree
reddit.com##div.commentarea
youtube.com###comments
||disqus.com/embed/comments/
||disqus.com/embed.js
###disqus_thread
##.dsq-brlink
##.disqus-container
Here’s how it should look like:
These rules block comments from:
- Hacker News
- YouTube
- Disqus (on all websites)
Optionally, for extra sanity and street cred, also add these rules 😎
||twitter.com
||facebook.com
A short primer on the syntax …
- Prefix CSS selectors with
##
; so##.dsq-brlink
will block HTML elements with a.dsq-brlink
class, and###disqus_thread
will block HTML elements with a#disqus_thread
ID- These CSS selectors can be “generic”, meaning they apply to all websites (in the case of Disqus), or they can apply to a specific domain: e.g.
###disqus_thread
is a cosmetic filter that applies to all websites, whereasyoutube.com###comments
filters HTML elements with a#comments
ID that are shown onyoutube.com
- See relevant cheat sheet section
- These CSS selectors can be “generic”, meaning they apply to all websites (in the case of Disqus), or they can apply to a specific domain: e.g.
- You can block specific resources from loading; a
||
prefix means that a domain name follows, until a separator such as/
- A rule such as
||disqus.com/embed.js
will block/embed.js
on all subdomains ofdisqus.com
- See relevant cheat sheet section
- A rule such as
For more details on these rules, see this cheat sheet:
Adblock filters explained
Publish it #
You can publish this list, as a text file, somewhere, anywhere, and reuse it wherever you have uBlock Origin installed. For example, I published mine at:
alexn.org/assets/misc/block-lists/no-comments.txt
You can then import it in uBlock Origin easily:
Safari / iOS (iPhone, iPad) #
Safari, on macOS and iOS, has content blockers too. Not as capable, but they do the job. An excellent one is Wipr, but it doesn’t allow setting custom rules.
- A prepackaged solution that can block comments is Quiet, but that’s less fun
- 1Blocker appears to allow for creating custom rules, but I haven’t tried it yet
- Building your own content blocker could be a fun project
If you know of a better solution, write about it in the comments section 😅😂