Disclaimer: I am just a random stranger on the internet who likes uBlock Origin, read a handy comment, and figured out how to press F12. I am by no means a webpage expert, and these changes may have unintended consequences
I wanted to bring more attention to @linuxFan@vlemmy.net’s comment on how to block entire instances (not just specific communities on those instances) from your “all communities” feed, as well as add my own method to block them from the “list of communities” page.
This only works if you are using a web browser that supports uBlock Origin (so unfortunately, will not work on any of the mobile apps).
Firstly, install uBlock Origin if you haven’t already. Then, click on the uBlock extension icon -> “Gears” (settings) icon -> My Filters. Per @linuxFan@vlemmy.net, add:
your.lemmy.instance.com##.post-listing:has-text(@theInstanceYouWantToBlock.com)
Then click “Apply Changes”
So if I were not interested in any of lemmynsfw.com
’s content, I would add:
lemmy.world##.post-listing:has-text(@lemmynsfw.com)
@linuxFan@vlemmy.net’s ELI5 explanation:
lemmy.world##
- only use this filter on this site
.post-listing
- evaluate everything on the page with the class name post-listing
has-text(@lemmynsfw.com)
- the text we want to filter. CASE SENSITIVE!
Similarly, if you want to filter entire instances out of the “list of communities” page, you would add:
your.lemmy.instance.com##tr:has-text(@theInstanceYouWantToBlock)
I believe the tr
is table-responsive
, which is the type of table displayed on the “list of communities” page. If there are other responsive tables on a different Lemmy page that I don’t know about, it may affect those. Also, if Lemmy’s website is updated, these filters may no longer work.
If someone knows of a better method of doing this, please chime in. But otherwise, enjoy!
Why YSK: some instances have many communities that are centered around topics people are not interested in, and instead of blocking all of those communities one by one, it is easier to just block the whole instance.
Edit: Note that this will remove posts if a blocked instance is listed ANYWHERE in the post body. I accidentally blocked my own post when I tested the lemmynsfw filter just now lol
Edit(s): Further clarification/typos
Thanks! Should be built in to easily block an entire instance
uBlock Origin works on Firefox Beta for Android.
I think it works on non-beta Android Firefox too. I just meant stuff like Jerboa, Mlem, etc; mobile apps you download from an app store.
I wonder if something like this could be used to exclude Reddit result from search engine pages.
Very useful, thank you for sharing!
Also if someone isn’t using ublock origin yet, please do! It’s essential to browse the internet these days
Pihole is great
You can also try out kbin as a Lemmy alternative, as it’s fully federated with Lemmy and lets you block domains.
Bless your soul my child. I can now get rid of lemmygrad.
What’s wrong with lemmygrad? Serious question since I’m out of the loop.
It’s essentially a community that promotes left wing extremist ideologies and is very much in favour of authoritarians who don’t like democracy. Lots of hate for the west, lots of whataboutisms and lots of love for Putin and Xi and lots of excuses for the invasion of Ukraine and the Uyghur genocide. I’m left leaning but they have more in common with fascists than anything else.
Tankies
how do i save this post on kbin?
What does going to Settings > Blocks > Block Community do? Doesn’t that work?
That blocks a single community on an instance, not the whole instance. So take this community, youshouldknow@lemmy.world. You can block youshouldknow (the community), but you cannot block all of lemmy.world (the instance). The method in my post allows you to block entire instances.
Ahhh, okay, thanks.
Exactly what I was looking for and the example is exactly what I wanted to do.
Small problem, this blocks every mention of lemmynsfw, even this post.