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.
- π 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
The script repeatedly performs the following actions:
- Finds the three-dot menu of the top video
- Opens the menu
- Searches for βRemove from Watch Laterβ
- Clicks the remove option
- Waits for YouTube to update
- Repeats until the playlist is empty
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
Go to:
From the left sidebar, click:
Library β Watch Later
Press:
F12
or
Ctrl + Shift + I
Cmd + Option + I
Then click the Console tab.
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.
At any time, you can stop it using:
F5
or
Ctrl + R
Ctrl + C
Browsers may pause inactive tabs, slowing the script.
For very large playlists:
- Refresh the page
- Scroll down a little to preload videos
- Run the script again
Possible reasons:
- You are not on the Watch Later page
- YouTube changed its HTML structure
- Browser blocked script execution
Try:
- Refreshing YouTube
- Scrolling down manually
- Running the script again
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.
Feel free to improve:
- Speed optimization
- Better selectors
- Pause / resume support
- Error handling
Pull requests are welcome!
MIT License β free to use and modify.
If this project helped you, consider giving it a star β on GitHub.