← Projects

YouTube Shorts Blocker

open source

A lightweight Chrome extension that hides YouTube Shorts everywhere and can redirect Shorts links.

YouTube Shorts Blocker cover art

Overview

Shorts show up all over YouTube: the home feed, search results, channel pages and the sidebar. This extension hides them. It runs locally in the page, with no accounts, telemetry or network requests of its own. It only runs on www.youtube.com and m.youtube.com, and its one permission, storage, remembers a single setting.

What it does

  • Hides Shorts cards, shelves, search filters and navigation entries
  • Redirects Shorts pages: a /shorts link goes to the YouTube home page, and a channel's Shorts tab goes to the channel itself
  • Lets you turn redirects off, so a Shorts link someone sends you still opens while your feeds stay clean. Redirects are on by default.
  • Fixes search filters: if the Shorts filter is selected, it switches to All when that button is available
  • Installs without a build step: download the ZIP from the latest release and load it in Chrome

How it works

Hiding happens in two passes. CSS hides the page elements YouTube uses only for Shorts, so they never appear. JavaScript then checks where each remaining card actually links to, rather than relying on how the markup looks, which holds up better when YouTube changes its layout. It also rechecks cards that YouTube reuses, so a card can reappear once it shows a normal video.

When a shelf mixes Shorts with regular videos, the extension leaves it alone, because hiding normal videos is worse than leaving a gap. Tests run the page logic under jsdom.

Limitations

YouTube serves different layouts depending on account, region and experiments, so an unfamiliar card may only have its Shorts link hidden, which leaves a gap. Buttons are detected by their English labels ("Shorts" and "All"); other languages rely on links and Shorts-only elements. The extension doesn't look at video length, and the same video still plays if opened as a regular /watch link.

Built with

Plain JavaScript on Manifest V3, with no runtime dependencies, and jsdom for tests.