Skip to content

Instantly share code, notes, and snippets.

@IanColdwater
Last active November 17, 2024 02:37
Show Gist options
  • Save IanColdwater/88b3341a7c4c0cf71c73ac56f9bd36ec to your computer and use it in GitHub Desktop.
Save IanColdwater/88b3341a7c4c0cf71c73ac56f9bd36ec to your computer and use it in GitHub Desktop.
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
suggest_grouped_tweet_hashtag
suggest_pyle_tweet
suggest_ranked_organic_tweet
suggest_ranked_timeline_tweet
suggest_recap
suggest_recycled_tweet
suggest_recycled_tweet_inline
suggest_sc_tweet
suggest_timeline_tweet
suggest_who_to_follow
suggestactivitytweet
suggestpyletweet
suggestrecycledtweet_inline
@GuillaumeRossolini
Copy link

To the people for whom this didn't work: try switching your timeline back to chronological (instead of popular, or however it is called).
@TylerBussel @ronaldKM98 @mjy @joshdance

@heygambo
Copy link

This seems interesting but I'm not 100% sure what it does 😅

@horvaro
Copy link

horvaro commented Jan 27, 2020

❤️

The fixed delay in the code was not working all the time for me. So I added a wait until the add page returns before clicking on the add button again.

(function(){
  const delayMs = 500; 

  const keywords = `ActivityTweet
  generic_activity_highlights
  generic_activity_momentsbreaking
  RankedOrganicTweet
  suggest_activity
  suggest_activity_feed
  suggest_activity_highlights
  suggest_activity_tweet
  suggest_grouped_tweet_hashtag
  suggest_pyle_tweet
  suggest_ranked_organic_tweet
  suggest_ranked_timeline_tweet
  suggest_recap
  suggest_recycled_tweet
  suggest_recycled_tweet_inline
  suggest_sc_tweet
  suggest_timeline_tweet
  suggest_who_to_follow
  suggestactivitytweet
  suggestpyletweet
  suggestrecycledtweet_inline`.split(/\W+/);

  const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;

  const addMutedKeyword = keyword => {
    const input = document.querySelector("[name='keyword']");
    nativeInputValueSetter.call(input, keyword);
    input.dispatchEvent(new Event('input', { bubbles: true }));
    document.querySelector("[data-testid='settingsDetailSave']").click();
  }

  const delay = () => {
    return new Promise(res => setTimeout(res, delayMs));
  };

  keywords.reduce(async (prev, keyword) => {
    await prev;
    
    // wait till the browser returns to the initial screen before clicking the add button again. 
    while(window.location.href !== 'https://twitter.com/settings/muted_keywords'){
      await delay();
    }
    document.querySelector("a[href='/settings/add_muted_keyword']").click();
    await delay();
    addMutedKeyword(keyword);
    return delay();
  }, Promise.resolve());
            
})()

@jimaldon
Copy link

Does this also work on the twitter android client?

@TylerBussell
Copy link

@TylerBussel - I think you're right, this does nothing, maybe @IanColdwater can edit this gist so this is not burried.

I had been playing with uBlockOrigin settings at the same time as I was playing with these, and going back and replicating, even taking some time to see if things took a while to take effect- I can't see any effect/replicate what I initially saw. And there is this:

https://twitter.com/TwitterSupport/status/1220872428605317122

Though if you read carefully there is wiggle room- they may have some other effect, but that seems to be grasping at straws.

But, until we get proof (screenshots(?)), this is bogus.

This has come up several times in the past. We made some changes to the timeline settings + someone released a JS plugin that did some blocking, so it caused some confusion and people thought muting via keyword mute did something.

@am1983
Copy link

am1983 commented Jan 27, 2020

Not all heroes where capes.

@stevetemp7
Copy link

Worked for me. Made twitter usable. Thanks.

@davidawad
Copy link

@madaboutcode's thing worked for me. Thanks!

@maxclark
Copy link

maxclark commented Feb 1, 2020

👏

@heygambo
Copy link

What does this do exactly?

@Zuhayer
Copy link

Zuhayer commented Feb 12, 2020

In case anyone wants to fully automate entering these in. I took @j6k4m8's snippet and expanded on it.

1. Visit https://twitter.com/settings/muted_keywords

2. Open your browser's dev tools (note: this does work in Chrome)

3. Paste the following code in:
const delayMs = 500; // change this if you feel like its running too fast

const keywords = `ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
suggest_grouped_tweet_hashtag
suggest_pyle_tweet
suggest_ranked_organic_tweet
suggest_ranked_timeline_tweet
suggest_recap
suggest_recycled_tweet
suggest_recycled_tweet_inline
suggest_sc_tweet
suggest_timeline_tweet
suggest_who_to_follow
suggestactivitytweet
suggestpyletweet
suggestrecycledtweet_inline`.split(/\W+/);

const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;

const addMutedKeyword = keyword => {
  const input = document.querySelector("[name='keyword']");
  nativeInputValueSetter.call(input, keyword);
  input.dispatchEvent(new Event('input', { bubbles: true }));
  document.querySelector("[data-testid='settingsDetailSave']").click();
}

const delay = () => {
  return new Promise(res => setTimeout(res, delayMs));
};

keywords.reduce(async (prev, keyword) => {
  await prev;
  document.querySelector("a[href='/settings/add_muted_keyword']").click();
  await delay();
  addMutedKeyword(keyword);
  return delay();
}, Promise.resolve());

Worked for me #firefox

@orbitalflower
Copy link

orbitalflower commented Feb 26, 2020

Muting these keywords appears to have no effect, at least in new web Twitter. Promoted tweets and follow suggestions still appear, and at the same rate as without the keywords muted.

I'm going to chalk this one up to the placebo effect. Adding these mutes and refreshing the feed will remove promoted tweets, but only because refreshing removes promoted tweets anyway. This reminds me of when D&D Online players believed that using the Diplomacy skill on a chest gave you better loot, so nobody could get a raid together without a high-ranking Diplomacy guy. Community moderators insisted that it had no effect, but nobody believed them. When the devs fixed the bug that let you talk to chests, players complained that their chest-ambassador characters had been nerfed and demanded the feature return.

Now, what was true is that in old Twitter, these "keywords" used to be used as CSS class names on Twitter, so you could write a custom CSS or adblock rule or something to hide these classes, and it would block promoted and suggested tweets very effectively. I suspect that at some point, someone got confused and thought these were keyword mutes, and the superstition spread because nobody tried to apply the scientific method to test whether keyword mutes actually worked.

@kaisdavis
Copy link

Muting these keywords appears to have no effect, at least in new web Twitter. Promoted tweets and follow suggestions still appear, and at the same rate as without the keywords muted.

Thanks for the confirmation.

@MatthiasPortzel
Copy link

I can confirm that this “works” when you first reload the page, but has no actual long term effect.

@mandaputtra
Copy link

~ still I see retweets, like, and follow

@Technetium1
Copy link

~ still I see retweets, like, and follow

@kaisdavis Yes you will see the expected user content, it just removes garbage

@rammahamazing
Copy link

Which code work for hide likes !?

@AdryDev92
Copy link

Thanks, this was very necessary.

@Technetium1
Copy link

Which code work for hide likes !?

@rammahamazing this is the point of Twitter.

@kaiserkiwi
Copy link

Any new term to mute these voice tweets?

@TheAshwanik
Copy link

In case anyone wants to fully automate entering these in. I took @j6k4m8's snippet and expanded on it.

  1. Visit https://twitter.com/settings/muted_keywords
  2. Open your browser's dev tools (note: this does work in Chrome)
  3. Paste the following code in:
const delayMs = 500; // change this if you feel like its running too fast

const keywords = `ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
suggest_grouped_tweet_hashtag
suggest_pyle_tweet
suggest_ranked_organic_tweet
suggest_ranked_timeline_tweet
suggest_recap
suggest_recycled_tweet
suggest_recycled_tweet_inline
suggest_sc_tweet
suggest_timeline_tweet
suggest_who_to_follow
suggestactivitytweet
suggestpyletweet
suggestrecycledtweet_inline`.split(/\W+/);

const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;

const addMutedKeyword = keyword => {
  const input = document.querySelector("[name='keyword']");
  nativeInputValueSetter.call(input, keyword);
  input.dispatchEvent(new Event('input', { bubbles: true }));
  document.querySelector("[data-testid='settingsDetailSave']").click();
}

const delay = () => {
  return new Promise(res => setTimeout(res, delayMs));
};

keywords.reduce(async (prev, keyword) => {
  await prev;
  document.querySelector("a[href='/settings/add_muted_keyword']").click();
  await delay();
  addMutedKeyword(keyword);
  return delay();
}, Promise.resolve());

Awesome.. Thank you.

@s7tya
Copy link

s7tya commented Jul 19, 2020

awesome!
i recommend to add who_to_follow_entry

@heygambo
Copy link

Would be great to have an explanation about what this is doing.

@mandaputtra
Copy link

@heygambo, to simplify... that code add to your twitter muted list. That's it nothing more. You can read it BTW. It's there

@shashemi-m
Copy link

I couldn't get this code to work on chrome, so I go to dev tools and paste it? But where, edit html and just paste?

@BenBE
Copy link

BenBE commented Sep 14, 2020

Use by pasting in the Console tab of the debug tools, while on the appropriate site in your Twitter settings.

@shashemi-m
Copy link

@BenBE Thank you! Is this still working? Seems like some people are saying it doesn't work anymore.

@BenBE
Copy link

BenBE commented Sep 14, 2020

Not tested recently.

@Ruuubickk
Copy link

Can confirm this still works, but i'd love to know which to add to get rid of those newly added topic following recommendations on the timeline.

@schuster
Copy link

This appears to have stopped working for me in the last couple of weeks. That, or there are new keywords that need to get added to the list. Any ideas on how to fix it? And any thoughts on how to keep this updated over time? I've seen similar lists posted on various websites (e.g. https://howtodotechystuff.wordpress.com/2019/07/23/make-twitter-useable-again/), but I have no idea how people are determining the set of topics.

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