I use the uBlock Origin browser plugin to filter my LinkedIn Posts, Notifications, and Comments to hide anything containing objectionable topics. uBlock Origin allows you to add custom rules to block web content.
How to use and setup uBlock Origin is beyond the scope of this post. It’s not hard, figure it out and then come back. What you want to know how to do is add your own custom rules.
Let’s say, for purposes of these example, I want to block all mentions of someone named Grump.
The simplest version: block a single word
The following three rules hide Posts, Comments, and Notifications, respectively, that contain the word “grump”, whether as a separate word, or as part of other words, such as “grumpier”.
Posts: www.linkedin.com##div:has( > .ember-view.occludable-update:has(div.fie-impression-container:has-text(/grump/i)))
Comments: www.linkedin.com##.comments-replies-list > .comments-thread-entity > .comments-thread-item > .comments-comment-entity--reply.comments-comment-entity:has-text(/grump/i)
Notifications: www.linkedin.com##div[data-finite-scroll-hotkey-item]:has-text(/grump/i)
That’s the basics. But now, maybe you want to hide things containing “Grump”, but not hide things talking about someone being “grumpier”.
Slightly more complex: block a word without blocking words containing it (block “Grump” but not “grumpier”)
This is fairly easy. To tell the rules “only block a full word, not part of a word”, you surround the word in \b
on each side (without the quotes). So you’d use \bgrump\b
in the rules.
So the above rules, adjusted to hide things containing “grump” but not containing “grumpier” would become:
Posts: www.linkedin.com##div:has( > .ember-view.occludable-update:has(div.fie-impression-container:has-text(/\bgrump\b/i)))
Comments: www.linkedin.com##.comments-replies-list > .comments-thread-entity > .comments-thread-item > .comments-comment-entity--reply.comments-comment-entity:has-text(/\bgrump\b/i)
Notifications: www.linkedin.com##div[data-finite-scroll-hotkey-item]:has-text(/\bgrump\b/i)
So, if you want to keep this sumple, you can stop reading here—just enter a of the above rules into the uBlock Origin custom rules for each word you want to block Posts, Comments, and/or Notifications containing, replacing grump
with that word.
For those who know how Regular Expressions work in programming, you can stop here. Everything in /slashes/
above is a Regular Expression, you can use those to block as complex a string as you want. For those who don’t know what a regular expression is, you don’t need to worry about it.
Now, if you want to know how to do even more complicated blocking, here’s some more in-depth rules. The above should suffice for anything, this is just if you’re interested in knowing more.
Blocking multiple words or phrases with one rule:
Let’s say you want to block multiple words. Say you want to hide all posts mentioning someone called “Grump” and also posts mentioning someone called “Sleazon Mush”. The way you include multiple words is by putting them in parentheses and separating them by a pipe, “|”, again without quotes, like: (grump|sleazon mush)
So now the rules to hide Posts, Comments, and Notifications containing either “Grump” or “Mush” would be:
Posts: www.linkedin.com##div:has( > .ember-view.occludable-update:has(div.fie-impression-container:has-text(/\b(grump|sleazon mush)\b/i)))
Comments: www.linkedin.com##.comments-replies-list > .comments-thread-entity > .comments-thread-item > .comments-comment-entity--reply.comments-comment-entity:has-text(/\b(grump|sleazon mush)\b/i)
Notifications: www.linkedin.com##div[data-finite-scroll-hotkey-item]:has-text(/\b(grump|sleazon mush)\b/i)
You can use any number of words. If you also wanted to block mentions of someone named “Lush Rimjaub” or someone named, you could use has-text(/\b(grump|sleazon mush|lush rimjaub)\b/i)
.