DEV Community

Cover image for Unsubscribe all YouTube channels at once!
Manitej ⚡
Manitej ⚡

Posted on • Updated on

Unsubscribe all YouTube channels at once!

Without any boring intro, let me get straight to the point.

  1. Go to this link

Alt Text

  1. Right-click and go inspect then go to console

Alt Text

  1. Now copy the below script and paste it on the console
function youtubeUnsubscriber() {
    var count = document.querySelectorAll("ytd-channel-renderer:not(.ytd-item-section-renderer)").length;
    var randomDelay = 500;

    if(count == 0) return false;

    function unsubscribeVisible(randomDelay) {

        if (count == 0) {
            window.scrollTo(0,document.body.scrollHeight);
            setTimeout(function() {
                youtubeUnsubscriber();
            }, 10000)
        }

        unsubscribeButton = document.querySelector('.ytd-subscribe-button-renderer');
        unsubscribeButton.click();

        setTimeout(function () {
            document.getElementById("confirm-button").click()
            count--;
            console.log("Remaining: ", count);

            setTimeout(function () {
                unsubscribedElement = document.querySelector("ytd-channel-renderer");
                unsubscribedElement.parentNode.removeChild(unsubscribedElement);
                unsubscribeVisible(randomDelay)
            }, randomDelay);
        }, randomDelay);
    }

    unsubscribeVisible(randomDelay);
}

youtubeUnsubscriber();
Enter fullscreen mode Exit fullscreen mode
  1. Hit enter and wait for some time to see the magic

Alt Text

After all are done, refresh the page.

Alt Text

Oldest comments (22)

Collapse
 
robcodes profile image
RobCodes

Whish I had this for about 10k email subscriptions over the years.

Collapse
 
manitej profile image
Manitej ⚡

Haha !

Collapse
 
pavelloz profile image
Paweł Kowalski

Why not just turn off notifications on yt?

Collapse
 
billraymond profile image
Bill Raymond

I’m 30 followers from monetizing my little corner of YouTube, so please don’t use this code if I am in the list :)

Collapse
 
zakariabenhirt89 profile image
Zakaria Benhirt

don't worry. i will subscribe instead

Collapse
 
billraymond profile image
Bill Raymond

Thank you! :)

Collapse
 
mbaapohz profile image
Mbaapoh

Hahaha

Collapse
 
craigdennis profile image
Craig Dennis

Can this be done on Twitter?

Collapse
 
manitej profile image
Manitej ⚡

Unfollowing everyone at once?

Collapse
 
pavelloz profile image
Paweł Kowalski

Another excercise: How to remove all my comments from all videos on YT? ;)

Collapse
 
manitej profile image
Manitej ⚡

This is exactly what I used this trick for!

Collapse
 
andrewbaisden profile image
Andrew Baisden

Wow this would have been useful when I had 100+ channels that I was trying to sort. Starting from scratch might have been easier.

Collapse
 
manitej profile image
Manitej ⚡

I have 500+ 🤐 So this trick is godsend for me!

Collapse
 
nikhilmwarrier profile image
nikhilmwarrier

Awesome tip. But I suppose YouTube might crash if i did that to all my 5M subscriptions....
Just kidding 😂

Collapse
 
manitej profile image
Manitej ⚡

Haha lol

Collapse
 
nikhilmwarrier profile image
nikhilmwarrier

Now make one that can delete all files in a GitHub repo branch. I am too lazy to go to the CLI, and the web ui of GitHub doesn't allow selecting or deleting multiple files...
Please and thank you in advance
😅👍

Collapse
 
cumaniar profile image
Chiragkumar Maniyar

😂

Collapse
 
manitej profile image
Manitej ⚡

Will work. I unsubbed more than 300 channels

Collapse
 
alexanderalemayhu profile image
Alexander Alemayhu

I am tired of hitting unsubscribe, thank you!

Collapse
 
jhoanmartinez profile image
Jhoan Martinez Silva

It worked but have to change the value of randomDelay, 500 not worked for me, 900 worked pretty good, anyways, thank you for the code

Collapse
 
maanik_arya profile image
Maanik Arya

Thanks Its Really a magic happens Thanks For this information

Collapse
 
eucfelipe profile image
Claudinei Felipe

After hours of looking for a script that worked, I found it. Thanks, God bless you!