Completely hide Shorts from Youtube and more…

I try to not spend too much time on Youtube for a few reasons. First I don’t have much time nowadays, secondly they want to keep you on their app and force you to watch ads and as I don’t like ads I want to spend the less time there.

My usage of Youtube was : I go there only to watch one video then close my tab I grab somewhere then I closed the tab. But I’ve found lately that it was not the case anymore, I got caught by Shorts thumbnails and watch one, two, four and I have lost a quarter of an hour in the blink of an eye.

UserScripts are the way to go

In order to remove some content from a page, UsersScripts are the easiest and most widespread solution, so I installed their extension that is available on all browsers and read some documentation. After a few minutes in devtools I ended up with this first script that removes everything related to Shorts in Youtube interface.

// ==UserScript==
// @name         Disable Youtube Shorts
// @grant        GM_addStyle
// @match        https://www.youtube.com/*
// @match        https://www.youtube-nocookie.com/*
// @match        https://m.youtube.com/*
// @match        https://music.youtube.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// ==/UserScript==
GM_addStyle(`
/* Remove shorts thumbnail in homepage and search */
[is-shorts], [aria-label="Shorts"], #guide-button, [tab-title="Shorts"] {
  display: none;
}
ytd-reel-shelf-renderer {
  display: none;
}
`)

The first selector is global to Youtube, whereas the second one is only for the search results, because I don’t want Shorts to be displayed in the search results either.

And voila, no more Shorts when I browse Youtube.

Some more changes to Youtube

My original goal was to remove Shorts only, but it was so easy that I thought that I could hide some other parts that I didn’t want. So I noticed that I could remove the left menu, then it was the «chips» under the search field, and finally the top right icons that are useful when you have an account (I don’t have one and don’t plan to have one).

So in the end, I’ve created a second script that hides those things :

// ==UserScript==
// @name         Disable Youtube Menu and Chips
// @grant        GM_addStyle
// @match        https://www.youtube.com/*
// @match        https://www.youtube-nocookie.com/*
// @match        https://m.youtube.com/*
// @match        https://music.youtube.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// ==/UserScript==
GM_addStyle(`
/* Remove the left menu and remove margin*/
#guide, ytd-mini-guide-renderer {
  display: none;
}
ytd-playlist-header-renderer {
  margin-left: 0 !important;
  left: 0 !important;
}
#page-manager {
  margin-left: 0;
}

/* Remove the chips on top of Youtube homepage */
ytd-feed-filter-chip-bar-renderer {
  display: none;
}
/* Remove the chips on top of Youtube search results */
ytd-search-header-renderer {
  display: none;
}

/* Remove Signin */
[aria-label="Sign in"] {
  display: none;
}

/* Remove Settings button */
[aria-label="Settings"] {
  display: none;
}
`)

The cleanest Youtube will ever be !

Success, now when I open Youtube, I don’t get Shorts anymore and I’m supposed to have content of interest based on what I’ve watched previously (except one, none interest me). Here is what my Youtube interface looks like on the homepage :

The Homepage of Youtube without Shorts and menu

Even the search results are cleaner as they are now «Short free» as well and have less distracting click zone, that would trigger me to click on it.

The search result page of Youtube without Shorts and menu

To be honest it may not be the cleanest Youtube, Invidious is my pick of choice and I would rather use it to watch videos, but their player is not very good for quite some time and playing videos can be quite sluggish, which is problematic on video platform.

Hopefully both scripts use selectors that should not be change too often by Google and I’m pretty confident to think it’s quite future proof. And if that’s not the case, doing the required adjustments can be done really quickly, and there is nothing Youtube can do about it.

As a final note, I completely stopped wasting time watching Shorts, the goal is achieved, the next step could be to automatically close a tab when I reach the end of a video, but that’s may be a little too extreme…