While this feature is available on many third-party apps, it’s not on the browser. However, since you’re already using an ad blocker, you can use it to filter out content as well.

To filter out posts with certain keywords, go to your custom filters and add this code. For example, to hide all posts containing the word “Elon”:

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

If your instance is something other than lemmy.world, just replace it with the correct domain.

To filter out comments, use this:

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

To add more keywords, simply duplicate the code and replace the keyword with another.

  • Susaga@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    51 minutes ago

    You might want to be careful of the Scunthorpe problem when doing this, and make sure you don’t filter out posts about melons as collateral damage.

    • Free_ThoughtsOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      45 minutes ago

      I think that if you add spaces around the keyword it then wont trigger if that word is contained within another word.

      Another thing to note is that the post filtering also applies to usernames.