Gustav Bylund

+46 (0)73 026 26 86 hello@gustavbylund.se maistho

Remove YouTube Shorts from subscription feed

Shorts mostly suck. This bookmarklet hides them!

Bookmarklet

Drag the following link to your bookmark bar!

Remove YT Shorts

Or add this code to a bookmark:

javascript:(()=>{function t(e,r){return r>0?t(e.parentElement,r-1):e}Array.from(document.querySelectorAll('a#video-title[href^="/shorts/"')).forEach(e=>{t(e,5).remove()});})();

Full code available below:

function getParent(el: Element, levels: number): Element {
  // Helper function to go up multiple parentNode levels
  if (levels > 0) {
    // biome-ignore lint/style/noNonNullAssertion: No need to check this, we are deep enough
    return getParent(el.parentElement!, levels - 1)
  }
  return el
}

Array.from(document.querySelectorAll('a#video-title[href^="/shorts/"')).forEach(
  (el) => {
    getParent(el, 5).remove()
  },
)