Sunday, May 12, 2024

Block "Sponsored", "Suggested for you" and "Recommended" posts on Facebook

Block "Sponsored", "Suggested for you" and "Recommended" posts on Facebook

Hi all!

So Facebook has a lot of crap posts in it's timeline that I would like to get rid off.

Adblock Plus allows us to block some content by XPATH
https://help.adblockplus.org/hc/en-us/articles/360060928614-Getting-started-with-XPath-filters

Here are filters to block those posts:

Sponsored

facebook.com#$#hide-if-matches-xpath '//a[starts-with(@href, "/ads/about")]/../../../../../../../../../../../../../../../../../../../../../../../..'

Suggested for you

facebook.com#$#hide-if-matches-xpath '//*[contains(text(),"Suggested for you")]/../../../../../../../../../../../../../../../../../../../../..'

Recommended (contains Follow button)

facebook.com#$#hide-if-matches-xpath '//a[starts-with(@href, "/ads/about")]/../../../../../../../../../../../../../../../../../../../../../../../..'

aaa is 🎮 playing bbb

I didn't find XPATH that would work on this.
Something like //span[contains(text(), 'is') and contains(text(), 'playing')] shoud work but it doesn't.

Blocking Suggested posts doesn't work reliably, probably because FB is a very messy and menstruous html. It shows up and disappears when you mouse hover over Suggested element.

Examples:

Sponsored

https://preview.redd.it/g9ef7h52b10d1.png?width=1276&format=png&auto=webp&s=f8f2cbd1a8fbfefa04670a3f0102668e2a162fe4

Recommended (Follow button)

https://preview.redd.it/splmhar5b10d1.png?width=1272&format=png&auto=webp&s=31ec15e2d9a695524ba2171475518d1a0a861304

Suggested for you

https://preview.redd.it/sy9u8onib10d1.png?width=1294&format=png&auto=webp&s=f7b7be6a01716db238f002e0445f02e38fd94101

AAA is 🎮 playing BBB

https://preview.redd.it/l2bc2h9mg10d1.png?width=1272&format=png&auto=webp&s=1ad98b1567dc9c4bf52a6cc619dac6ae9883dfc5

submitted by /u/Technical_Ad_6200
[link] [comments]


No comments:

Post a Comment