Skip to content

HarshLogic/Youtube-Watch-Later-Auto-Remove-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ₯ YouTube Watch Later Mass Deleter

JavaScript Browser License

A lightweight JavaScript browser-console automation script to remove videos from your YouTube Watch Later playlist automatically.

Since YouTube does not provide a β€œDelete All” option for Watch Later, this script automates the repetitive process of opening each video menu and clicking Remove from Watch Later for you.


✨ Features

  • πŸš€ Automatically removes videos from Watch Later
  • ⚑ Fast and lightweight (no installation needed)
  • πŸ”’ No third-party APIs or login required
  • πŸ–±οΈ Simulates normal browser clicks
  • πŸ’» Works directly in browser developer console
  • πŸ›‘ Can be stopped anytime

πŸ“Œ How It Works

The script repeatedly performs the following actions:

  1. Finds the three-dot menu of the top video
  2. Opens the menu
  3. Searches for β€œRemove from Watch Later”
  4. Clicks the remove option
  5. Waits for YouTube to update
  6. Repeats until the playlist is empty

πŸ›  Requirements

Before using the script, make sure you have:

  • A desktop browser:
    • Google Chrome
    • Microsoft Edge
    • Brave
    • Safari
  • A YouTube account with videos in Watch Later
  • Access to browser Developer Console

πŸš€ Usage

Step 1: Open YouTube

Go to:

https://www.youtube.com


Step 2: Open Watch Later Playlist

From the left sidebar, click:

Library β†’ Watch Later


Step 3: Open Browser Console

Windows / Linux

Press:

F12

or

Ctrl + Shift + I

Mac

Cmd + Option + I

Then click the Console tab.


Step 4: Paste and Run This Script

const sleep = ms => new Promise(r => setTimeout(r, ms));

(async function clearWatchLater() {
    let removed = 0;

    console.log("Cleaning Watch Later...");

    while (true) {
        const btn = document.querySelector(
            '#primary ytd-playlist-video-renderer yt-icon-button.dropdown-trigger'
        );

        if (!btn) {
            console.log(`Done! Removed ${removed} videos.`);
            break;
        }

        btn.click();
        await sleep(300);

        const items = document.querySelectorAll(
            'tp-yt-iron-dropdown [role="menuitem"], ytd-menu-service-item-renderer'
        );

        let found = false;

        for (const item of items) {
            if (item.textContent.includes("Remove from")) {
                item.click();
                removed++;
                found = true;
                console.log(`Removed: ${removed}`);
                break;
            }
        }

        if (!found) {
            console.log("Remove option not found, scrolling...");
            window.scrollBy(0, 100);
        }

        await sleep(500);
    }
})();

Press Enter to start.


πŸ›‘ How to Stop the Script

At any time, you can stop it using:

Option 1: Refresh the page

F5

or

Ctrl + R

Option 2: Stop from Console

Ctrl + C

Make sure their YouTube interface language is set to English before running it.

πŸ’‘ Tips for Large Playlists

Keep the Tab Active

Browsers may pause inactive tabs, slowing the script.

If the Script Freezes

For very large playlists:

  1. Refresh the page
  2. Scroll down a little to preload videos
  3. Run the script again

πŸ” Troubleshooting

Script does nothing

Possible reasons:

  • You are not on the Watch Later page
  • YouTube changed its HTML structure
  • Browser blocked script execution

β€œRemove” button not found

Try:

  • Refreshing YouTube
  • Scrolling down manually
  • Running the script again

πŸ“œ Disclaimer

This script depends on YouTube’s current page structure. If YouTube updates its interface, selectors may need to be updated.

Use at your own risk.


🀝 Contributing

Feel free to improve:

  • Speed optimization
  • Better selectors
  • Pause / resume support
  • Error handling

Pull requests are welcome!


πŸ“„ License

MIT License β€” free to use and modify.


⭐ Support

If this project helped you, consider giving it a star ⭐ on GitHub.

About

Youtube Watch Later Automatic Remove Script

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors