Skip to content

Instantly share code, notes, and snippets.

@Lazza
Created January 3, 2023 16:03
Show Gist options
  • Save Lazza/50af7eb641a0262931bca910c52fc6c6 to your computer and use it in GitHub Desktop.
Save Lazza/50af7eb641a0262931bca910c52fc6c6 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