It’s no surprise that twitter and similar sink holes are constantly trying to "engage" you so you can be sucked into their void. As someone who believes that the web belongs to its users and I browse the way I want I frequently change and block content on these sites so I can use them the way I would like.

So here’s a quick share on how I’m doing that.

[I’ve published 38 videos for new developers, designers, UX, UI, product owners and anyone who needs to conquer the command line today.](https://training.leftlogic.com/buy/terminal/cli2?coupon=BLOG\&utm_source=blog\&utm_medium=banner\&utm_campaign=remysharp-discount)

This is a simple example of how I think twitter can be improved - the picture below shows, highlighted in red, the "trending news" which really isn’t news - or at least not news that I would recommend consuming. I certainly don’t want to get my COVID-19 advice from the latest trending bullshit. More recently they have launched (possibly in split tests) a DM … "thing"? so I can use that to message people instead of…what, email? WhatsApp? Not sure. Anyway, it’s shit that I don’t need in my life, so it’s getting ejected.

![](/images/clean-twitter.png)

Step 1: get yourself [uBlock Origin](https://github.com/gorhill/uBlock/) (the origin bit is important) available for [most browsers](https://github.com/gorhill/uBlock/#installation)

Step 2: use the right click - block element picker to stop content from bothering you

When you fire up the picker, you’ll notice that Twitter (and other sites that don’t believe in writing actual CSS classes) are using something to generate their CSS, which makes picking element using CSS selectors tricky.

Except, the trick is to look for aria roles or even data properties. As much as I dislike these big companies, they do try to support a broad range of users via good use of accessibility and we can use that to our advantage.

![](/images/picking.png)

The uBlock Origin element picker will need a selector like ##div[aria-label="Timeline: Trending now"], I’m not sure what the double hash is about, but it works.

So now we can surf web pages the way we want.

Published 19-Jun 2020 under #web. [Edit this post](https://github.com/remy/remysharp.com/blob/main/public/blog/clearing-twitter.md)

👍 22 likes

[![cato](https://webmention.io/avatar/pbs.twimg.com/cdbf903bf71e1713aa30c6886b6941d7641865757d832a3b28e8ca7126978969.jpg "cato")](![Handy(https://webmention.io/avatar/pbs.twimg.com/ba63acf27bda8785ac3f1c4bc0ac3c3e119f81c1eafd5b4651300cb55ac9362e.jpg "Handy")](![ᴋᴏᴠáᴄs ᴍáᴛé(https://webmention.io/avatar/pbs.twimg.com/3a710fb53ecfc6e9e3da5065d4ab6652fcb495f3f928859607ffe3a12685b9f0.jpg "ᴋᴏᴠáᴄs ᴍáᴛé")](![Torben(https://webmention.io/avatar/pbs.twimg.com/ecdf3ac055480df8ac9afb7a52b1375514bbc0529c896d7c05c8a48a05f0b12c.jpg "Torben")](![Major Nelson(https://webmention.io/avatar/pbs.twimg.com/83c744a76156a8d3f61aa00b79f00650b9f530dcd9a47896f4ae826f088b951c.jpg "Major Nelson")](![Daniel McLaughlin(https://webmention.io/avatar/pbs.twimg.com/432a5d858fe9a67d7eca59d312ba13048cbf355b15628d9959bcf0326ebcb333.png "Daniel McLaughlin")](![Ricard Torres(https://webmention.io/avatar/pbs.twimg.com/2f27ed759e5b8979764c0bc2a5d3ad247f3798f2ac46933cb52097fd14b62fca.png "Ricard Torres")](![Josh Compton 🌎(https://webmention.io/avatar/pbs.twimg.com/fd7d8c1341055488d481cb58e87ab36cca1b90314844db61c67b3ecfe0266a3b.jpg "Josh Compton 🌎")](![IndieScripter(https://webmention.io/avatar/pbs.twimg.com/4f713297b91f33d35d7b68a51adcc11b399da631130799031542a0094fe1be9c.jpg "IndieScripter")](![Islam Younis(https://webmention.io/avatar/pbs.twimg.com/b6d06dd8955f3749ef148663e7732abd9abe89ecc6ca4bf291631123489490dd.png "Islam Younis")](![Bobby Duff(https://webmention.io/avatar/pbs.twimg.com/202c058429b4e2054f72f961cca7bb1e96393fdb3ea299990ef4be15c50e24ca.png "Bobby Duff")](![Mohamed Azazy(https://webmention.io/avatar/pbs.twimg.com/d279ab313388b177be7ed82ab1df95310c5b80ca3972891a9950ca8abfa3ae09.jpg "Mohamed Azazy")](![Nicholas Mercer(https://webmention.io/avatar/pbs.twimg.com/5a0e0294a29355b5727d9e6a93b44db4ad401b9480678b9850befbb299a873d7.jpg "Nicholas Mercer")](![yifen(https://webmention.io/avatar/pbs.twimg.com/720adb30300b3121ee5ed1fc31a97fd1ee923dc8fdbb7e318a5f3a389daf5e09.jpg "yifen")](![Henry Lim(https://webmention.io/avatar/pbs.twimg.com/0e514dd2ced31176e71eec49d309ad9b8734855f849ba083e33cefcadee84df8.jpg "Henry Lim")](![Ryan Holder(https://webmention.io/avatar/pbs.twimg.com/d1ef0759132ed78ec297fe3a200feaef0055f68a042302ddb5e69b595c718bbe.jpg "Ryan Holder")](![Vebjørn Letnes Berg(https://webmention.io/avatar/pbs.twimg.com/2a517e1f80c407ca99c198cf0617417755f727999ecd0ad029d16035ff01e526.jpg "Vebjørn Letnes Berg")](![Stefan(https://webmention.io/avatar/pbs.twimg.com/cafd8bf6a633bee5c42f76ed0f47eb1c60410880623e326fb6bf4b21768bcd37.jpg "Stefan")](![Jakub G(https://webmention.io/avatar/pbs.twimg.com/022fe28926eb4af270a34b628e2604e24ef3ceb128db2b50b2f1da09b08b6885.png "Jakub G")](![Dylan Smith(https://webmention.io/avatar/pbs.twimg.com/9dcad2ac7698cee7afc5564654780c54b2c344d2b5f1071149c13ce9d7e92308.jpg "Dylan Smith")](![Christopher Hamilton 🇪🇺(https://webmention.io/avatar/pbs.twimg.com/cd620faed05183031f5111d56d60b891b658880671fe9a5e1aaecc8276e9a07d.png "Christopher Hamilton 🇪🇺")](![Nik Bailey(https://webmention.io/avatar/pbs.twimg.com/ddfc594eb9b2b7d27a98db0709438fbf81a148efda6bc875fdd1eaa9636eff79.jpg "Nik Bailey")](https://twitter.com/nikobe)

Comments

Lock Thread

Login

Add Comment[M ↓   Markdown]()

[Upvotes]()[Newest]()[Oldest]()

Daniel Nash

0 points

3 years ago

This works for me to keep sponsored rubbish out of Facebook

facebook.com##div[data-pagelet^=FeedUnit_]:has(span:has-text(/^Suggested for You$/))
facebook.com##div[data-pagelet^=FeedUnit_]:has(div[role=button] > span > span > span:has-text(/^S$/) ~ span:has-text(/^p$/) ~ span:has-text(/^o$/) ~ span:has-text(/^n$/) ~ span:has-text(/^s$/) ~ span:has-text(/^o$/) ~ span:has-text(/^r$/))

0 points

3 years ago

The ## is a special syntax to enable element hiding. In Adblock Plus, we try to maintain, and keep updated, some hopefully decent documentation about filters: https://help.eyeo.com/adblockplus/how-to-write-filters#elemhide_css

We provide also a cheat-sheet here: https://adblockplus.org/filter-cheatsheet so I hope these are welcome extras to your article.

Needless to say that Adblock Plus allows the same trick you explained in here, but there’s one thing I’d like to tell you: "only a psycho would use Twitter without dark theme on a dark themed browser/console" 😜

1 point

3 years ago

Re: dark theme mixup combo: 😃 I like to keep my brain on it’s toes, and my toes on the floor.

1 point

3 years ago

here are the relevant docs for ublock origin as well https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#specific-generic

[Commento](https://commento.io)