Bulk Unsubscribe From YouTube Channels With a Browser Script
YouTube does not provide a single “unsubscribe from everything” button. For a short list, the sensible option is to open YouTube, go to Subscriptions → Manage, and remove channels one by one.
For hundreds of subscriptions, a browser script can repeat those clicks. It is quicker, but also brittle and destructive. Test it on a few channels before trusting it with the whole list.
Run the script from the subscription manager
Open the page that lists all subscriptions, then open Developer Tools and select Console. Browsers warn about pasted code because it runs with the same access you have on the page. Read it first; never paste a script from a source you do not trust.
The following script matched YouTube’s interface when this article was published:
(async function iife() {
var UNSUBSCRIBE_DELAY_TIME = 2000;
var wait = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
async function scrollPage() {
window.scrollBy(0, window.innerHeight);
await wait(1000);
}
var totalUnsubscribed = 0;
async function unsubscribeFromChannels() {
try {
var channels = Array.from(
document.querySelectorAll(
"ytd-subscription-notification-toggle-button-renderer-next > yt-button-shape > button"
)
);
if (channels.length === 0) {
console.log("No more channels to unsubscribe.");
return;
}
console.log(channels.length + " channels found.");
for (const channel of channels) {
channel.click();
await wait(100);
document
.querySelector("#items > ytd-menu-service-item-renderer:nth-child(2)")
.click();
await wait(800);
document
.querySelector("#confirm-button > yt-button-shape > button > yt-touch-feedback-shape")
.click();
await wait(UNSUBSCRIBE_DELAY_TIME);
console.log("Unsubscribed " + (totalUnsubscribed + 1) + " / " + channels.length);
totalUnsubscribed++;
}
await scrollPage();
unsubscribeFromChannels();
} catch (e) {
console.error(e);
}
}
unsubscribeFromChannels();
})();
The selectors look for subscription buttons and confirmation controls. The waits give the interface time to update and reduce the rate of actions. The script then scrolls to load more channels and repeats.
Expect it to break eventually
Those long selectors depend on YouTube’s internal HTML, not a stable public API. If the script finds nothing or clicks the wrong control, stop. Do not “fix” it by choosing selectors at random while logged in.
Reloading can help after a temporary failure or rate limit, but it cannot repair an interface change. Inspect the current page, update the code deliberately, and test with one expendable subscription.
For anything less than a very large cleanup, I would use the manual list. Automation saves time only while you still understand what it is about to remove.