Remove Twitter’s intrusive ad content from feed in Safari…

For a multitude of reasons, I am no fan of ad-supported apps or contents. Unfortunately, I am in the minority there, and major net services overwhelmingly rely on increasingly sneaky ad-placement strategies to “monetise” their eyeball traffic.

Twitter does it in a particularly irritating way, by inserting ads “promoted content” straight into the feed, with only the tiniest of indication that what you are seeing was not posted by someone you know, but by some random paying customer.

Fortunately, if you use Safari on a mac, there is an easy fix for that:

  1. Open a command shell.
  2. Copy-paste the following two lines (make sure to hit return at the end):

    echo '.promoted-tweet {display:none;!important;}' > ~/Documents/hide_promoted_tweets.css
    defaults write com.apple.safari UserStyleSheetEnabled 1 && defaults write com.apple.safari UserStyleSheetLocationURLString "~/Documents/hide_promoted_tweets.css" && defaults write com.apple.safari WebKitUserStyleSheetEnabledPreferenceKey 1 && defaults write com.apple.safari WebKitUserStyleSheetLocationPreferenceKey "~/Documents/hide_promoted_tweets.css"

  3. Done!

Note 1: you can easily modify the above to highlight/mark promoted tweets rather than hiding them completely, by changing the ‘display:none’ part (e.g. replacing it by ‘background-color:yellow‘).

Note 2: alternatively, if you don’t want/know how to run command lines in OS X:

  1. Download this very basic css file1.
  2. Open Safari’s Preferences, click on the “Advanced” tab.
  3. In the “Style Sheet” section, select “Other…” and browse to the file you just downloaded/created.
  1. or you can just create a new file with this single line in it: .promoted-tweet {display:none;!important;} (don’t forget the full stop at the start). []

1 comment

  1. Hello dave
    my name is tagy and i applied to MEXT this year, your blog is very useful.. thank you
    i wanna ask you about machine learning and software engineering labs in japan, and if you can suggest me some labs
    thank you in advance

Leave a Reply