Block Twitter Previews

Custom filters for µBlock/Adblock/Adblock Plus.

Add -> twitter.com##.stream-item:not(.open) .tweet .media
UPDATED DEC 17, 2013! (blocks normal *single* images)

Add -> twitter.com##.stream-item:not(.open) .tweet .multi-photos
UPDATED MAR 28, 2014 (blocks new multi-image tweet images)

Add -> twitter.com##.stream-item:not(.open) .tweet .js-macaw-cards-iframe-container
UPDATED JUN 30, 2015 (re-blocks vine)

Add -> twitter.com##.stream-item:not(.open) .tweet .js-media-container
UPDATED JUL 6, 2015 (blocks animated gifs)

Removed -> twitter.com##.stream-item:not(.open) .tweet .js-tweet-details-dropdown
UPDATED JUN 30, 2015 (used to block vines, but not anymore)

Add -> twitter.com##.stream-item:not(.open) .tweet .js-old-media-container
UPDATED OCT 31, 2015 (blocks new image div)

Add -> twitter.com##.stream-item:not(.open) .tweet .js-adaptive-media-container
UPDATED DEC 9, 2015 (blocks yet another image div)

 

All together now… for easy cut and paste…

twitter.com##.stream-item:not(.open) .tweet .media
twitter.com##.stream-item:not(.open) .tweet .multi-photos
twitter.com##.stream-item:not(.open) .tweet .js-macaw-cards-iframe-container
twitter.com##.stream-item:not(.open) .tweet .js-media-container
twitter.com##.stream-item:not(.open) .tweet .js-old-media-container
twitter.com##.stream-item:not(.open) .tweet .js-adaptive-media-container

These filters don’t (usually) remove the content. They just hide it until you click the tweet (usually), mimicking the old way twitter handled displayed content. It gets finicky sometimes and twitter keeps changing, so mileage may vary…

Install µBlock, Adblock or Adblock Plus Extension:

Add above in custom filters

DONE!

If you have any difficulties, or need instructions for another browser, please feel free to ask me here or on Twitter. (@patrixmyth)

Have a good day!

 

OPTIONAL UPDATE Dec 19, 2015 (shows quoted RTs)
The above list is still the best I’ve got, but recently decided to remove .js-media-container from my own browser, so I can see quoted tweets. Totally up to you, and it does expose thumbnail images on retweeted tweets. Just helps me follow conversations better. Cheers, and thanks for the positive feedback. Lord knows I need it.

 

Errata: While this filters do preserve ‘click’ viewing of content, it gets finicky on RTs or after comments. Works sometimes, not others. *Previews not working for adaptive media 🙁  As always, I will update if I find better solutions.

21 comments for “Block Twitter Previews

  1. March 31, 2014 at 4:07 pm

    Bookmarked. Will be doing this tonight. Thank you!

    • patrixmyth
      March 31, 2014 at 4:14 pm

      Happy to help.

  2. Heidi
    August 5, 2014 at 12:47 am

    Hi. Is there a filter(s) to hide photos and vine vids on profile pages themselves? Filters hide newsfeed so far but also looking to hide them on individual Twitter pages/profiles. Thanks for the above filters too BTW! 🙂

    • patrixmyth
      August 11, 2014 at 10:36 am

      If I understand what you’re looking for correctly, then
      adding this->
      twitter.com##DIV[class=”TwitterPhoto js-media-container”]

      to your custom filters should take care of photos.

      I haven’t found a solution for vines yet, but when I come up with something I’ll update.

  3. Hill
    October 16, 2014 at 3:09 am

    This:

    twitter.com##.stream-item:not(.open) .tweet .js-media-container

    Seems to work very well for me. It blocks even photo previews from twitter searches (which the others couldn’t do).

  4. Neonie
    October 28, 2015 at 12:08 am

    As of today my current set of filters have stopped working.

    • Neonie
      October 28, 2015 at 12:27 am

      Edit: Nvm, figured it out with the help of a friend.

      • Rich
        October 28, 2015 at 9:32 am

        What was your solution??

        • Neonie
          October 28, 2015 at 9:35 am

          The previous set of filters were:

          twitter.com###xdm_default8923_provider
          twitter.com##.card2-attribution
          twitter.com##.expanded-content
          twitter.com##.js-tweet-details-dropdown
          twitter.com##.util-text-small
          twitter.com##div.is-preview

          Two new filters are now necessary:

          ##div.js-old-media-container
          ##div.OldMedia-container

          • Rich
            October 28, 2015 at 9:38 am

            I love the Internet. And now I can use Twitter without having an aneurysm. Thanks!!

        • Neonie
          October 28, 2015 at 9:40 am

          There internet is pretty damn rad.

          And you’re welcome.

          • patrixmyth
            October 31, 2015 at 10:57 pm

            Great input. Thanks! Wish I’d read your message before digging round for the old media tag myself!

  5. Silvia
    October 28, 2015 at 8:15 am

    Good morning! I’m using Win10, Chrome and AdBlock Plus, and unfortunately your filters for ABP do not hide the previews for photos. I don’t know about Vines or multi-pix yet, haven’t come across them since adding filters, but the pix are still there in my TL. Any advice?

    • patrixmyth
      October 31, 2015 at 11:04 pm

      Check out the update that adds old-media div to filters 🙂 Not fully tested, but it’s best I’ve got so far.

      • Silvia
        November 6, 2015 at 6:22 am

        Thank you! The only filter I personally needed to block out image preview was this one:
        twitter.com##.stream-item:not(.open) .tweet .js-old-media-container
        It works perfectly! The image is still visible when I click on the tweet but the automatic expansion Twitter enforces is gone.
        Thank you thank you thank you! 😀

  6. Damrak
    October 31, 2015 at 2:10 am

    Since a few days

    twitter.com##.stream-item:not(.open) .tweet .media

    doesn’t hide the preview anymore.

    I tried any combination of other filters. They either hide both preview and image in my timeline, or neither one of them. I can’t find a combination of filters that do hide the preview but do not hide the image when you click on the tweet.

    Neonie’s 8 filters don’t show any image anymore in Firefox 41.0.2.

    Any suggestions?

  7. Damrak
    October 31, 2015 at 2:29 am

    Analysis:

    Out of those 8, Adblock shows no hits for these 4:

    twitter.com###xdm_default8923_provider
    twitter.com##.card2-attribution
    twitter.com##.util-text-small
    twitter.com##div.is-preview

    So they seem useless anyway.

    Both these two:

    twitter.com##.expanded-content
    twitter.com##.js-tweet-details-dropdown

    hide retweet and favorite score. Which I don’t need to be hidden, so these filters can be removed too.

    That leaves these two:

    ##div.js-old-media-container
    ##div.OldMedia-container

    Whether I use one of them or both, the result in all cases is that all images are hidden, both the preview and the picture that is shown after clicking the tweet.

    • patrixmyth
      October 31, 2015 at 10:59 pm

      Excellent… wish my blog would show me these comments faster 🙂 Would have saved me time researching, but yours did eliminate some work. Thanks! I expect more changes soon…

    • patrixmyth
      October 31, 2015 at 11:24 pm

      Note the format of the filters I listed… the not(.open) is important to preserve click to see images/media…

  8. December 7, 2015 at 11:27 pm

    Looks like Twitter changed their containers again today. This is what worked for me:

    twitter.com##.stream-item:not(.open) .tweet .js-adaptive-media-container

  9. Lorenzo
    December 12, 2015 at 10:35 am

    Thank you so much for your recent updates! This information doesn’t appear to be found anywhere else – please continue the good work 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *