Unsubscribe from all your YouTube channels with one weird trick

Here’s a short one for you. I have wanted to clear my list of subscribed channels in YouTube for a long time. Unfortunately, it seems that in recent years, there’s no automated way of doing this. If, like me you are subscribed to a lot of channels on YouTube, this means that you need to click on each channel you are subscribed to and selecting the ‘Unsubscribe’ button.
In my case, it was quicker to write a short snippet of JavaScript that manipulates the DOM in order to achieve this. I’m sharing this here to save someone from repeating my efforts, as long as YouTube doesn’t change the layout of their subscriptions page any time soon.
To unsubscribe from all your YouTube channels, open chrome and visit https://www.youtube.com/subscription_manager.
Open the console by typing F12 and copying and pasting the following code:

subscription_items = document.getElementsByClassName('subscription-item');
for (i = 0; i < subscription_items.length; ++i) { item = subscription_items[i];
    dialog_base = document.getElementsByClassName('preserve-players');
    unsubscribe_butt = dialog_base[0].getElementsByClassName('overlay-confirmation-unsubscribe-button');

Leave a Reply

Your email address will not be published. Required fields are marked *