Skip to content

Instantly share code, notes, and snippets.

@IanColdwater
Last active October 13, 2024 04:40
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
@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.

@lando2319
Copy link

I feel like something has changed, in recent days this list has been completely ineffective for me.

Does anyone have a way to capture new IDs? I tried inspecting element and wasn't able to see an ID

@devashishp
Copy link

Hi! Thank you for this gist, has been super useful to me. Does anyone know if there's a phrase I can mute to stop seeing tweets from "Suggested Topics"?

@fharper
Copy link

fharper commented Jan 7, 2021

I use @catarino version, thanks!

@ambv
Copy link

ambv commented Mar 23, 2021

@madaboutcode's version of the automation script works well in Firefox.

@otamagu
Copy link

otamagu commented Apr 19, 2021

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());

Can someone tell me how to insert it in Chrome step by step? Thank you so much.

Copy link

ghost commented Apr 19, 2021

can anyone explain meaning of each term?!

@Technetium1
Copy link

This no longer works. Don't bother trying.

@otamagu
Copy link

otamagu commented Apr 21, 2021

Try "RT @" without quote and all likes and Retweet will not appear on your timeline.

@nmdra
Copy link

nmdra commented Jul 22, 2021

anyone can explain how to work this?

@nmdra
Copy link

nmdra commented Jul 23, 2021

I will venmo someone $100 if they can prove to me that muting these keywords works.

RT @ keyword working

@dav1dddd
Copy link

dav1dddd commented Oct 3, 2021

Expanded on @jakebellacera's script to make it work for my browser. Visit https://twitter.com/settings/add_muted_keyword, open your browser's javascript console, and paste the following script in:

const delayMs = 1000; // 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;
  addMutedKeyword(keyword);
  await delay();
  document.querySelector('[aria-label="Add muted word or phrase"]').click();
  return delay();
}, Promise.resolve());

Thank you, works!

@ksoda
Copy link

ksoda commented Nov 21, 2021

It just works

location.assign("https://twitter.com/settings/muted_keywords");
// wait...

// https://github.com/facebook/react/issues/10135#issuecomment-401496776
function setNativeValue(element, value) {
  const valueSetter = Object.getOwnPropertyDescriptor(element, "value").set;
  const prototypeValueSetter = Object.getOwnPropertyDescriptor(
    Object.getPrototypeOf(element),
    "value"
  ).set;

  if (valueSetter && valueSetter !== prototypeValueSetter) {
    prototypeValueSetter.call(element, value);
  } else {
    valueSetter.call(element, value);
  }
}

function delay(f = 1) {
  return new Promise((res) => setTimeout(res, f * 1000));
}

`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+/)
  .reduce(async function go(prev, keyword) {
    await prev;

    document.querySelector('[aria-label="Add muted word or phrase"]').click();
    await delay();

    const el = document.querySelector("input[name=keyword]");
    setNativeValue(el, keyword);
    el.dispatchEvent(new Event("input", { bubbles: true }));
    await delay();

    document
      .evaluate(
        '//*[contains(text(), "Save")]/ancestor::*[@role = "button"]',
        document,
        null,
        XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
        null
      )
      .snapshotItem(0)
      .click();
    return delay();
  }, Promise.resolve());

I didn't even see the behavior change

@EpicLPer
Copy link

EpicLPer commented Mar 2, 2022

Still not sure if this actually works still or not.

@schuster
Copy link

schuster commented Mar 3, 2022

I never got this working again after it stopped working for me over a year ago, but I found a better option for me: you can switch to chronological ordering in the mobile app by tapping the star icon in the upper-right, then tapping "switch to latest tweets". The chronological mode doesn't show any of the suggested tweets, likes, etc., which is exactly what I want.

@mwbrooks
Copy link

mwbrooks commented Mar 3, 2022

Very helpful @schuster, this is exactly what I wanted as well. Thanks! 🙇

@Nin10Doug
Copy link

Nin10Doug commented Jun 30, 2022

Wish to know what each of these actually do. I've seen some of em remove replies from the same user who made the main tweet, but I'm unsure which. Would be nice to know what each one did. Or if this are some that are missing too.

@freezetreat
Copy link

It just works

location.assign("https://twitter.com/settings/muted_keywords");
// wait...

// https://github.com/facebook/react/issues/10135#issuecomment-401496776
function setNativeValue(element, value) {
  const valueSetter = Object.getOwnPropertyDescriptor(element, "value").set;
  const prototypeValueSetter = Object.getOwnPropertyDescriptor(
    Object.getPrototypeOf(element),
    "value"
  ).set;

  if (valueSetter && valueSetter !== prototypeValueSetter) {
    prototypeValueSetter.call(element, value);
  } else {
    valueSetter.call(element, value);
  }
}

function delay(f = 1) {
  return new Promise((res) => setTimeout(res, f * 1000));
}

`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+/)
  .reduce(async function go(prev, keyword) {
    await prev;

    document.querySelector('[aria-label="Add muted word or phrase"]').click();
    await delay();

    const el = document.querySelector("input[name=keyword]");
    setNativeValue(el, keyword);
    el.dispatchEvent(new Event("input", { bubbles: true }));
    await delay();

    document
      .evaluate(
        '//*[contains(text(), "Save")]/ancestor::*[@role = "button"]',
        document,
        null,
        XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
        null
      )
      .snapshotItem(0)
      .click();
    return delay();
  }, Promise.resolve());

I didn't even see the behavior change

Doesn't work anymore

@ReneFennet
Copy link

ReneFennet commented Sep 11, 2022

Works like a charme:

Question. I still get "Related Tweets" at the end of a thread, if any. How do I silence those?

@bmorphism
Copy link

Perhaps it is time to add 🧵 - these threads are out of control!

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