Userscript to hide YouTube comments and suggestions

Posted on June 29, 2026

Why

In an effort to limit my “social” media exposure and be much more deliberate about using it, I developed a userscript that hides YouTube comments and suggestions as I found their often pathetic efforts for attention unworthy of the same.

Mobile

I didn’t get the script to work properly on YouTube mobile (m.youtube.com) yet but you can use a custom uBlock Origin filter.

Install uBlock Origin and click on its icon, then the gear icon to open its dashboard. Click on “My filters”, make sure that “Enable my custom filters” is checked and paste the following two lines into the text field. Click “Apply changes” and reload YouTube.

The first hides the first comment being displayed truncatedly. You’ll still be able to open the comments by tapping on the grey field, only the comment preview in it will be hidden. The second line hides suggested videos entirely.

m.youtube.com##.ytCommentTeaserCarouselItemViewModelHost
m.youtube.com##.related-items-container

Desktop

Installing the script

Chrome

Just download the script by clicking on the Download raw file button with the arrow on it. Open chrome://extensions and drag-and-drop the file into Chrome. Chrome should ask if you want to install it. You can also disable or remove it here.

Alternatively, you can also use a dedicated userscript manager from the Chrome web store. Read the paragraph on Firefox to learn how to install the script in such a manager.

Firefox and others

Firefox requires you to install a userscript manager add-on. One of the most famous ones is Greasemonkey. I’m using Tampermonkey because it is available across different browsers and also offers a nice configuration interface with a built-in editor.

After Tampermonkey is installed, click on the following link. Tampermonkey should display the script and ask if you want to install it: Click to install

Using the script

With the script enabled, comments and suggestions will be hidden by default.

You can make them visible by clicking the respective buttons “C” for comments and “S” for suggested videos. If either doesn’t appear immediately after clicking the respective button, try scrolling a little.

Userscript to hide YouTube comments

You can enable/disable the automatic hiding and button for comments and suggestions respectively using the variables enableForSuggestions and enableForComments at the very top.

You can also easily modify the button texts. Change the values of the text variables in the buttonConfig dictionary accordingly. If you don’t know what that means: you’ll want to change "C" and "S" below the buttonConfig line.

Finally, you can adapt the style of the buttons using the buttonStyle variable.

Source code

The source is available on GitHub.