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##:not(:not(head>title:has-text(/^Ars Technica/))) 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.

    • Blaze (he/him)
      link
      fedilink
      English
      143 months ago

      Wait, how? I thought Lemmy default UI had no filter. Are you using Photon, Alexandrite or a mobile app?

    • zkfcfbzrOP
      link
      fedilink
      English
      12
      edit-2
      3 months ago

      Where? I see the option to block users, instances, and communities, but not words.

      And regardless, I think this method has value because it can be applied to pretty much any website with a bit of tinkering, and it can be turned on and off with a couple of clicks. I actually started out with the ars filter before making one for Lemmy.

    • @[email protected]
      link
      fedilink
      53 months ago

      So, are you answering the questions from the comments on where lemmy has this setting hidden, because I am looking for it for over a year now and you got 7 upvotes and 3 people asking where this option is. Please let us know.

    • @[email protected]
      link
      fedilink
      English
      43 months ago

      And it’ll be faster and more efficient to do it server side as opposed to making uBlock Origin handle it.

      • @[email protected]
        link
        fedilink
        3
        edit-2
        3 months ago

        I think it’s better to use distributed filtering than having their SQL query do additional filtering. Every user who uses filtering adds to the lifting their side has to do - while your CPU probably sits under 1% utilization most of the time.

        I’d rather Lemmy have filtering on the client-side, and just shoot us raw data.

        • @[email protected]
          link
          fedilink
          English
          2
          edit-2
          3 months ago

          Not all filtering is the same. Client side filtering requires more data to passed over the network that then just gets dropped. It also means rules that are not shared across devices.

          Most importantly, these use CSS filters which are computationally more expensive because it has to take an entire DOM element, serialize it to text, string search it vs a server side filter that can just look at a one or two field variables. Even if it’s not filtered in SQL on Lemmy’s side I’d say it’s still more efficient overall.

          You do what you want, but adding extra work on the client side is not what I’d want for my users. Of course, if your Lemmy instance does not supporting filtering, then this is moot.

  • @[email protected]
    link
    fedilink
    73 months ago

    Was literally updating my filtered words just now. I use Voyager app on iOS and it can be done in the settings.

    Voyager Settings

    • ReallyZen
      link
      fedilink
      4
      edit-2
      3 months ago

      On Android, in Connect and Voyager you can block URLs too, hence getting rid of toxic / clickbaity sources beyond filtering for specific keywords

      That’s just great, thanks Connect and Voyager devs!

  • @[email protected]
    link
    fedilink
    73 months ago

    Thank you! Lemmy is basically unusable right now for those of us not from America. Every community from technology to gaming is wall to wall DAE TRUMP HITLER!? I get it, but some of us just want to talk about our hobbies. There are dedicated communities for discussing politics.

  • @[email protected]
    link
    fedilink
    53 months ago

    It helps, and thanks for ublock idea for web browser users.

    but because post titles aren’t required to contain the keywords, I still see a lot of political crap.

  • @[email protected]
    link
    fedilink
    3
    edit-2
    3 months ago

    I’ve been using similar, but slighly different ones that I assume do the same thing. You can also copy the filter and just replace the filter word rather than including them all in one. Naturally here the instance name must be also changed to that of yours.

    lemmy.world##div.post-listing:has(span:has-text("/trump/i"))

    And for filtering comments:

    lemmy.world##article.comment-node:has(div.comment-content:has(p:has-text(/trump/i)))

    • zkfcfbzrOP
      link
      fedilink
      English
      33 months ago

      At one point I had the very similar filter lemmy.world##.post-listing:has-text(/trump/i), but I wasn’t happy with it because it would also remove post content on actual post pages, not just the post feed. That was the whole reason I swapped to the article.row solution instead - posts in the feed have the row class while posts on their own page don’t. But it looks like you found an alternate solution to achieve essentially the same thing. Neat!

      I have no real interest in filtering out comments, but it’s nice to have that option there for people who do.

  • Optional
    link
    fedilink
    33 months ago

    Voyager has a wonderful filter list under Settings -> Filters & Blocks. Works great and you can back up your settings to a json file in case you need to reload them.

    • lurch (he/him)
      link
      fedilink
      63 months ago

      my title filters btw:

      Orban,Trump,Vance,Elon,Musk,NATO,Scholz,Merz,Habeck,AOC,Thunberg,Tunberg,Greta,Mr. Beast,MrBeast,Bitcoin,Putin,Russia,Kremlin,AfD,Grünen,Gaza,Israel,Palestine,Democrat,Republican,Surpreme,Abortion,Taliban,China,Chinese,Harris,Biden,Genocide,Tory,Brexit,Google,Microsoft,Windows,Apple,iPhone,Android,OpenAI,ChatGPT,Lora,intel,nvidia,arch,mint,ubuntu,framework,raspberry,pihole,pipewire,linux,bezos,amazon,fairphone,Europeans,Brics,leyen,swift,immigrant,Santis,California,Youtube,Montag, Laberfaden,G'sudert wird,Bluesky,Twitter,Montagslaberfaden,blsky,bluesky,isglitch.com,Gaetz,Kulturfreitag,Jimmy Carter,Boebert,Pokemon
      
  • @[email protected]
    link
    fedilink
    -13 months ago

    Is there some kind of combination of words to filter out post bitching about having to see posts?

    • Blaze (he/him)
      link
      fedilink
      English
      03 months ago

      You can hide specific posts on Lemmy 0.19.4, unfortunately LW is still on 0.19.3