Skip to content

Instantly share code, notes, and snippets.

@hervehobbes
Forked from Lazza/Twitter-ads-hiding.md
Created October 28, 2023 04:44
Show Gist options
  • Save hervehobbes/8032dbdb522c85976f89ff8bf64c6ed8 to your computer and use it in GitHub Desktop.
Save hervehobbes/8032dbdb522c85976f89ff8bf64c6ed8 to your computer and use it in GitHub Desktop.
Hiding Twitter ads (January 2023)

Hiding Twitter ads (January 2023)

Ads on post-Elon Twitter are becoming more and more obnoxious. You can hide them if you use a content blocking extension, such as the awesome uBlock Origin.

By targeting the little icon that appears near the "Sponsored" label, the filter works on Twitter in every language.

Simply add the following rule to your ad-blocker:

! 2023-01-02 https://twitter.com
twitter.com##section>div>div>*:has(path[d='M19.498 3h-15c-1.381 0-2.5 1.12-2.5 2.5v13c0 1.38 1.119 2.5 2.5 2.5h15c1.381 0 2.5-1.12 2.5-2.5v-13c0-1.38-1.119-2.5-2.5-2.5zm-3.502 12h-2v-3.59l-5.293 5.3-1.414-1.42L12.581 10H8.996V8h7v7z'])

The idea was inspired by a discussion here on GitHub:

ryanckulp/twitter_ad_blocker#17 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment