A Tampermonkey/Greasemonkey userscript that hides YouTube notifications matching keywords you choose.
Default keywords: live, shorts, 30 minutes.
- Install a userscript manager: Tampermonkey (Chrome, Edge, Firefox) or Greasemonkey (Firefox).
- Open
YouTube Notification Filter.user.jsand click Raw — your userscript manager prompts to install. - Reload YouTube.
Open your userscript manager's menu (Tampermonkey icon → YouTube Notification Filter → Edit filter keywords) and enter a comma-separated list. Keywords persist across sessions and existing notifications re-filter immediately — no page reload or source editing needed.
Matching is case-insensitive and uses word boundaries: live matches "live" but not "delivered". The default 30 minutes still matches the literal phrase.
Clear the field entirely to disable filtering — an intentional empty list is remembered as-is, not reset to the defaults.
A MutationObserver watches the page (YouTube is a single-page app that injects notifications dynamically). DOM changes are coalesced with requestAnimationFrame, then the script scans unprocessed ytd-notification-renderer elements and hides any whose text matches a keyword. Each notification is flagged once so it isn't re-scanned on later mutations.
- Notifications are hidden via CSS (
display: none), not deleted from your account — the unread bell badge still counts them. - Relies on YouTube's current DOM structure (
ytd-notification-renderer). If YouTube changes its markup, filtering may stop working until the selector is updated.
MIT — see LICENSE.