Skip to content

Instantly share code, notes, and snippets.

@rohieb
Last active April 25, 2022 12:38
Show Gist options
  • Save rohieb/5df57de7625e0a2182f364b3c2b88599 to your computer and use it in GitHub Desktop.
Save rohieb/5df57de7625e0a2182f364b3c2b88599 to your computer and use it in GitHub Desktop.
Twitter Timeline Declutter user script
// ==UserScript==
// @name Twitter Timeline Declutter
// @namespace http://twitter.com/
// @version 2
// @description Remove "Who to Follow", "While you were away", "You might like" etc. from your timeline stream
// @author rohieb
// @homepage https://gist.github.com/rohieb/5df57de7625e0a2182f364b3c2b88599
// @updateURL https://gist.githubusercontent.com/rohieb/5df57de7625e0a2182f364b3c2b88599/raw
// @match *://twitter.com/*
// @grant GM_addStyle
// ==/UserScript==
function hideItems(n) {
style = n + " { display:none !important; }";
console.log(style);
GM_addStyle(style);
}
hideItems(".WtfLargeCarouselStreamItem"); // "who to follow"
hideItems(".has-recap"); // "while you were away" and "you might like"
hideItems(".PromptbirdPrompt-streamItem"); // "Make a Moment" etc.
hideItems("div[data-component-context='suggest_activity_tweet']"); // "XYZ liked…"
hideItems(".promoted-tweet");
hideItems(".js-activity-generic"); // "XYZ liked/retweeted…" in notifications
//hideItems(".Trends"); // for testing
@rohieb
Copy link
Author

rohieb commented Apr 25, 2022

I haven't been using Twitter for a long time, feel free to fork and adapt it.

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