DEV Community

EinfachRuwen
EinfachRuwen

Posted on

How to massive unsubscribe YouTube-Channels

YouTube is a popular platform for consuming and discovering content from various channels. However, over time, you may find yourself subscribed to numerous channels that no longer interest you. Manually unsubscribing from each channel can be a time-consuming process. In this article, we will guide you through the steps to quickly unsubscribe from all YouTube channels at once using a script.

Prerequisites:

Before proceeding with the steps, ensure that your YouTube language settings are set to English. This will help you navigate the interface more easily.

Step 1: Accessing Subscription Settings:

Open YouTube in your web browser and sign in to your account.
On the left-hand side of the page, locate and click on the "Subscriptions" link. It is usually found below the YouTube logo and above the sidebar menu.

Step 2: Managing Subscriptions:

Once you are on the Subscriptions page, look for the "Manage" button, usually located towards the right side of the page.
Click on the "Manage" button to access the subscription management options.

Step 3: Opening the Browser Console:

To open the browser console, right-click on any blank area of the page. Make sure you do not right-click on any channel name or subscription.
From the context menu that appears, select "Inspect" or "Inspect Element." This will open the browser developer tools.

Step 4: Pasting the Script:

In the developer tools panel, locate the "Console" tab. It is usually found at the top of the panel.
Click on the "Console" tab to open the console window.
You can now paste the script that automates the unsubscribing process into the console.

/**

* YouTube bulk unsubscribe fn.

* Wrapping this in an IIFE for browser compatibility.

*/

(async function iife() {

// This is the time delay after which the "unsubscribe" button is "clicked"; Change it as per your need!

var UNSUBSCRIBE_DELAY_TIME = 2000

/**

* Delay runner. Wraps `setTimeout` so it can be `await`ed on.

* @param {Function} fn

* @param {number} delay

*/

var runAfterDelay = (fn, delay) => new Promise((resolve, reject) => {

setTimeout(() => {

fn()

resolve()

}, delay)

})

// Get the channel list; this can be considered a row in the page.

var channels = Array.from(document.getElementsByTagName(`ytd-channel-renderer`))

console.log(`${channels.length} channels found.`)

var ctr = 0

for (const channel of channels) {

// Get the subscribe button and trigger a "click"

channel.querySelector(`[aria-label^='Unsubscribe from']`).click()

await runAfterDelay(() => {

// Get the dialog container...

document.getElementsByTagName(`yt-confirm-dialog-renderer`)[0]

// and find the confirm button...

.querySelector(`[aria-label^='Unsubscribe']`).click()

console.log(`Unsubsribed ${ctr + 1}/${channels.length}`)

ctr++

}, UNSUBSCRIBE_DELAY_TIME)

}

})()
Enter fullscreen mode Exit fullscreen mode

Note: Please exercise caution while using any external scripts or code on websites. Only use trusted sources and scripts.

Step 5: Running the Script:

After pasting the script into the console, press the "Enter" key to execute it.
The script will automatically initiate the process of unsubscribing from all YouTube channels.
Be patient and allow the script to complete its task. Depending on the number of subscriptions, it may take some time to unsubscribe from all channels.

By following the steps outlined in this article, you can quickly unsubscribe from all YouTube channels at once, saving you time and effort. Remember to exercise caution when using external scripts and ensure they come from trusted sources. Enjoy a clutter-free YouTube experience tailored to your preferences!

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post