Thank you to zkfcfbzr@lemmy.world for this superb trick.

cross-posted from: https://lemmy.world/post/24545370

Why YSK: Certain topics are stressful and tend to spread all over the site, including to unrelated communities. Blocking communities can be overkill and ineffective, and likewise for blocking individual users.

To do so, open up the uBlock Origin dashboard, go to the ‘My filters’ tab, and add this filter:

lemmy.world##article.row:has-text(/word1|word2|word3|word4/i)

For example:

lemmy.world##article.row:has-text(/Trump|Elon|Musk|nazi/i)

Then apply the changes and reload any open tabs, and all posts which contain any of your filtered words will simply not show up.

You’ll have to change “lemmy.world” at the start to whatever your actual instance is. You can filter as many or as few words as you want, just keep the / at the start, the /i at the end, and separate words with | pipes. What’s actually being filtered is a case-insensitive regex, if you want to get fancy with it.

Here are equivalent filters for reddit and Ars Technica:

reddit.com##div.thing[data-context="listing"]:has-text(/word1|word2|word3|word4/i)
arstechnica.com##article:has-text(/word1|word2|word3|word4/i)

As a disclaimer, I made these myself, and I’m not particularly familiar with creating uBlock Origin filters. There may be better ways to do this. Also the reddit one is specific to old.reddit.com, and the lemmy filter is made to work with the default lemmy.world web UI and may not work on other UIs without tinkering.

Yes, I know I’m just hiding my head in the sand.

  • Somewhiteguy@lemmy.world
    link
    fedilink
    arrow-up
    2
    arrow-down
    3
    ·
    15 hours ago

    As neat as this is, I feel like you’d miss a lot of important things depending on the list you put in. I understand not wanting to be flooded by garbage, but be careful to not fully check-out of things that will affect you.

    • Nazis marching in the next town over could be something to know about.
    • Trump talking to your PM might be of a concern.
    • Musk opening a Lithium battery facility near your hometown might be something to think about.

    I hate that we (the US) is ruining the news cycle again with absolute garbage, but please don’t harm yourself in avoiding it.