This user script automatically filters out tweets containing specific words, phrases, or emojis from your Twitter/X timeline. It runs in the background while you browse Twitter/X and removes matching tweets in real-time. The default block feature on Twitter only blocks content in the body of the post. This will also filter out users with those items in their names.
- Avoid spoilers
- Avoid politics
- Avoid bots
- Avoid parody accounts
- Avoid triggering content
- Avoid anything :)
- Real-time filtering: Continuously scans your timeline as you browse
- Emoji support: Filters tweets containing specific emojis (e.g., flags)
- Dynamic content handling: Works with Twitter/X's infinite scrolling
- Case-insensitive matching: Ignores capitalization differences
- Customizable word list: Easily modify the filter terms
- Console logging: Optionally displays removed tweets for debugging
-
Install a userscript manager:
- Tampermonkey (Chrome, Firefox, Safari, Edge)
- Greasemonkey (Firefox)
-
Install the script:
- Direct Install Link
- Or copy/paste the script code into a new userscript
Customize the filter by editing these values in the script:
// Words/emojis to filter (case-insensitive)
const TARGET_WORDS = ['๐บ๐ฆ', '๐ฎ๐ฑ','NAFO','Trump','Elon'];
// How often to check for new tweets (milliseconds)
const CHECK_INTERVAL = 1000; To modify:
- Open Tampermonkey dashboard
- Find "Twitter Word Filter" script
- Click "Edit"
- Modify the
TARGET_WORDSarray - Save changes with Ctrl+S / Cmd+S
- Scans your timeline every second (configurable)
- Checks all text content within tweets
- Examines image alt-text for emojis and keywords
- Removes entire tweets containing any target word/emoji
- Monitors DOM changes to handle new tweets as they load
- Browsers: Chrome, Firefox, Edge, Safari
- Sites: twitter.com, x.com
- Userscript Managers: Tampermonkey, Greasemonkey, Violentmonkey
-
If tweets aren't being removed:
- Refresh the page
- Check Tampermonkey dashboard to ensure script is enabled
- Verify target words match exactly (including emojis)
- Open browser console (F12) to check for error messages
-
To see removal logs in console:
- Open browser developer tools (F12)
- Navigate to "Console" tab
- Look for "Removed tweet containing:" messages
- Doesn't work with Twitter's mobile site or app
- Twitter/X DOM changes may require script updates
Contributions are welcome! Please open an issue or pull request.