If you have ever found yourself subscribed to hundreds of YouTube channels over the years and want to clean house, you know the pain. YouTube does not provide a built-in way to bulk unsubscribe. Clicking through each channel manually is tedious and time-consuming.
Here is a simple JavaScript snippet that automates the process directly in your browser.
The Script
Copy and paste this into your browser console while on the YouTube channels page:
(async function iife() {
const UNSUBSCRIBE_DELAY_TIME = 2000; // delay in ms
const runAfterDelay = (fn, delay) =>
new Promise(resolve => setTimeout(() => {
fn();
resolve();
}, delay));
const channels = Array.from(document.querySelectorAll("ytd-channel-renderer"));
console.log(`${channels.length} channels found.`);
let ctr = 0;
for (const channel of channels) {
const unsubscribeBtn = channel.querySelector("[aria-label^='Unsubscribe from']");
if (!unsubscribeBtn) {
console.log(`Skipped channel ${ctr + 1} (no unsubscribe button).`);
ctr++;
continue;
}
unsubscribeBtn.click();
await runAfterDelay(() => {
const dialog = document.querySelector("yt-confirm-dialog-renderer");
if (dialog) {
const confirmBtn = dialog.querySelector("[aria-label^='Unsubscribe']");
confirmBtn?.click();
console.log(`β
Unsubscribed ${ctr + 1}/${channels.length}`);
} else {
console.warn(`β Dialog not found for channel ${ctr + 1}`);
}
ctr++;
}, UNSUBSCRIBE_DELAY_TIME);
}
console.log("π Done unsubscribing all visible channels!");
})();
How to Use
- Go to youtube.com/feed/channels
- Scroll down to load all the channels you want to unsubscribe from (the script only works on visible/loaded channels)
- Open the browser console: Press
F12orCtrl+Shift+J(Windows/Linux) /Cmd+Option+J(Mac) - Paste the script above and press
Enter - Watch the console output as it processes each channel
The script includes a 2-second delay between each unsubscribe action to avoid triggering any rate limits.
How It Works
The script queries the page for all channel elements (ytd-channel-renderer), then for each one:
- Finds the unsubscribe button by its ARIA label
- Clicks it to open the confirmation dialog
- Waits for the delay period
- Clicks the confirmation button
- Logs progress to the console
The runAfterDelay helper uses a Promise to ensure each action completes before moving to the next channel.
Safety Notes
- There is no undo β once unsubscribed, you will need to re-subscribe manually if you change your mind
- Test first β consider trying it on just a few channels to ensure it works with the current YouTube layout
- Adjust timing β if you get rate-limited, increase
UNSUBSCRIBE_DELAY_TIMEto 3000ms or higher - Layout changes β YouTube updates their UI frequently; if selectors break, you may need to inspect the page and update the query selectors
Alternative: Manual Clean-Up
If you prefer a more controlled approach:
- Use the βManageβ button on the channels page to see subscriptions in a list view
- Third-party tools like YouTube Subscription Manager browser extensions offer more control with preview features
Wrapping Up
This snippet has saved me hours of tedious clicking. Your subscription feed becomes much more manageable when you trim channels you no longer watch. Use it responsibly and happy cleaning!