Skip to content

Instantly share code, notes, and snippets.

@NoelJacob
Created August 31, 2025 13:27
Show Gist options
  • Save NoelJacob/661b7555f0197f560c2b5f6d11e410bd to your computer and use it in GitHub Desktop.
Save NoelJacob/661b7555f0197f560c2b5f6d11e410bd to your computer and use it in GitHub Desktop.
Youtube channel notification mass remove

Mass remove notifications from all channels you are subscribed too.

  1. Open https://www.youtube.com/feed/channels
  2. Scroll down until all channels are loaded
  3. Paste the following in devtools console
/**
 * =================================================================
 *                        CHANNEL SCRIPT
 * =================================================================
 * This script WILL make changes to your notification settings.
 * It will loop through each of your loaded subscriptions and set
 * the notification level to "None".
 */

const PROCESS_DELAY_MS = 1500;

function sleep(ms) {
    return new Promise(resolve => setTimeout(resolve, ms));
}

async function setAllNotificationsToNone() {
    console.log("--- Starting LIVE YouTube Notification Script ---");
    console.warn("This script will now make changes to your account settings.");

    // 1. Get all channel elements from the page.
    const channels = document.querySelectorAll('ytd-channel-renderer');
    console.log(`Found ${channels.length} channels to process.`);

    if (channels.length === 0) {
        console.error("No channels found. Please make sure you have scrolled to the very bottom of your subscriptions list before running the script.");
        return;
    }

    let changedCount = 0;
    
    // 2. Loop through each channel element.
    for (let i = 0; i < channels.length; i++) {
        const channel = channels[i];
        const channelName = channel.querySelector('#text.ytd-channel-name')?.textContent.trim() || `Channel #${i + 1}`;

        console.log(`\nProcessing ${i + 1}/${channels.length}: ${channelName}`);

        try {
            // 3. Find the main notification button for the current channel.
            const bellButton = channel.querySelector('ytd-subscription-notification-toggle-button-renderer-next button');
            
            if (!bellButton) {
                console.warn("  - Could not find the bell button. Skipping.");
                continue;
            }

            // Check if notifications are already off by looking for the slashed-bell icon.
            if (bellButton.querySelector('path[d^="m3.85"]')) {
                console.log("  - Notifications are already set to 'None'. Skipping.");
                continue;
            }

            // 4. Click the bell button to open the menu.
            console.log("  - Clicking the notification bell...");
            bellButton.click();
            
            // Wait for the menu to appear.
            await sleep(PROCESS_DELAY_MS / 2);

            // 5. Find the "None" option in the menu that appears.
            const menuItems = document.querySelectorAll('ytd-menu-popup-renderer ytd-menu-service-item-renderer');
            let noneOption = null;
            for (const item of menuItems) {
                if (item.querySelector('yt-formatted-string')?.textContent.trim() === 'None') {
                    noneOption = item;
                    break;
                }
            }
            
            // 6. If the "None" option was found, CLICK IT.
            if (noneOption) {
                console.log("  - SUCCESS: Found and clicking 'None' option.");
                noneOption.click();
                changedCount++;
            } else {
                console.error("  - FAILED to find the 'None' option. Closing menu to proceed.");
                // Attempt to close the menu by clicking the bell again to avoid getting stuck.
                bellButton.click();
            }

            // 7. Wait before moving to the next channel.
            await sleep(PROCESS_DELAY_MS);

        } catch (error) {
            console.error(`  - An error occurred while processing ${channelName}:`, error);
        }
    }

    console.log(`\n--- SCRIPT FINISHED ---`);
    console.log(`Successfully changed notifications to 'None' for ${changedCount} channel(s).`);
}

setAllNotificationsToNone();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment