Enhance your X (Twitter) experience with Twat Doc: a powerful userscript featuring customizable content filters to hide spam, foreign languages, they/them lib content (🏳️⚧️, 🏳🌈, 🍉, 💉, etc), and low-quality posts; automuting based on user scores; visual tweaks like relative timestamps, larger buttons, and direct video links to view videos with your brower's native player
当前为
2025-09-14 - phase 1 complete. still some work to be done, but it's largely manageable now
2025-09-12 - I am fixing a memory leak where the backend dictionary that stores all of the post info is not being properly cleared when the URL changes such as switching between trends, For You, Following, communities, etc within the same page cycle (ie, navigating without full page refreshes). I am doing thorough testing and will have it patched soon.
This userscript enhances the X (formerly Twitter) experience by providing customizable content filters, automuting, and various quality-of-life improvements. Below is a succinct description of each content handler available in the script. These handlers process posts in feeds, allowing removal, modification, or scoring based on specific criteria. Enable or disable them via the settings; they activate on the next feed load without requiring a full page refresh. Note that enabling many handlers may cause performance issues on slower devices.
Note: Content is not removed from feeds unless [code]general > enableDeletes[/code] is enabled. Otherwise, it will display the qualifying information in the post template.
About content removal: X tracks viewed content in For You feeds. Removing posts from API responses before they appear in the feed may cause X to contuously refetch them, potentially blocking new content while X attempts to clear its internal content delivery queues. The [code]experimental > clickNotInterestedIn[/code] option allows such posts through, but auto-clicks "Not interested in this post" in the caret menu, notifying X via API to stop showing them and hopefully improve feed flow. Enable with deletes if feeds appear stagnant or empty.
Flags and scores authors based on indicators like pronouns, specific emojis (e.g., 🏳️⚧️, 🏳🌈, 🍉, 💉), or hashtags (e.g., #ACAB, #BLM) in posts, with lower scores for more matches. Supports automuting if scores hit thresholds. Processor-intensive due to regex usage; optional flag emoji checks (e.g., 🇪🇺, 🇮🇳) are experimental and may yield false positives.

Tracks and hides previously viewed posts stored in browser local storage, with cleanup schedules based on hours to prevent localStorage bloat. Configurable age and view count thresholds for hiding; optional auto-click of 'Not interested' in post menus to influence platform algorithms (use cautiously).


Enhances the user interface and display elements on X for better usability and accessibility. These options modify post templates, timestamps, and media handling without altering core functionality.
Video links added to post template:
Filters out foreign-language posts from feeds, especially in trends and searches. Configurable language confidence thresholds reduce mislabeling errors; options to hide banned languages or Grok-translated posts. Recommend adding language filters like 'lang:en' in [code]search > args[/code] for backend enforcement.

Provides granular control over content types from users, including allowing or hiding reposts, quotes, self-reposts, self-quotes, and unavailable quotes. Ideal for reducing self-promotion or redundant content.

Analyzes engagement metrics like view-to-follower or like-to-follower ratios to identify potentially biased or low-quality content. Configurable like count thresholds; options to show extended metrics or always display ratios for all posts.
Forcibly removes content from muted, blocked, or blocking accounts, including their reposts and quotes, even in feeds where X normally shows them (e.g., profiles, communities).


Cleans the Replies tab in user profiles by removing non-reply content like posts, reposts, and quotes.
Removes all community-related content from feeds like For You or trends. Future plans include whitelisting joined communities.

Removes subscription-locked posts. Untested with subscribed accounts; may affect promoted content from followed subscriptions.

Controls visibility based on account attributes, such as hiding content from users with default profile pictures.
Cleans up feeds flooded with hashtag and mention spam, especially in political trends. Configurable thresholds hide posts exceeding a set number of hashtags or mentions. Applies universally to all feeds.
Detects and notifies about users spamming trends or searches by tracking post counts in feeds. Includes optional scoring multipliers to adjust user quality scores based on post frequency, aiding in muting spammers. Scoring feature is experimental and may need refinement.
Improves search result quality by hiding posts where hashtags, mentions, or search terms dominate the content beyond a configurable percentage threshold. Options to include or exclude hashtags, mentions, and search terms in the calculation for targeted filtering.
Handles removal of posts referencing unavailable content.

Hides content from verified business accounts (yellow/gold star badges).
Removes posts containing $ symbols, targeting stock, crypto, or financial content.
Hides content from accounts marked as parody.
Removes posts from accounts with 'elon' or 'musk' in the name, excluding @elonmusk.
In searches or trends, hides content from accounts whose usernames contain the search query.
In this example where "Kiefer" was trending, a good portion of the feed results were accounts with "kiefer" in the authors' name fields.

Removes posts with links matching domains in the author's bio. Effective for filtering news or self-promoted content, but may hide legitimate links like YouTubers' own videos.

These content handlers are either a work in progress or need refinement before they're ready for public use. Many of these are features I began working on to suit my own purposes and may remove content you wish to see. It's best to keep these disabled.
Alerts on inconsistent capitalization in racial terms (e.g., 'black' capitalized but not 'white'). Currently non-functional and should remain disabled.
Hides content from gimmick video accounts based on username patterns. Criteria hardcoded; disable to avoid unintended filtering.
Removes posts containing hardcoded banned links. User-defined links planned; keep disabled unless matching personal preferences.
Color-codes posts by age for quick staleness assessment. Disable until colors and thresholds become configurable.
Miscellaneous experimental filters for testing new features. Keep disabled as they are not fully developed.