When seeing a good Youtube video, it is common for people to add it to the Youtube Watch Later list to “watch later”. The problem is that the list keeps adding up and becoming bigger and bigger.
- See also: Youtube Thumbnail Grabber
The Watch Later list on Youtube is a great way to keep track of videos that you want to watch later. However, the list can quickly become overwhelming and cluttered if not managed correctly.
When the Watch Later list becomes too big, it will loose its purpose of keeping track of wanted videos. Users start deleting watched videos or uninteresting ones. But they must click “Remove from Watch later” for a hundreds of videos.
In most cases, people would rather not do this and simply leave the list as it is. This can lead to a lot of wasted time scrolling through videos that you have already seen or have no interest in. Therefore, it is important to keep your Watch Later list manageable so that it remains useful or find a good solution to delete all videos.
Bulk-deleting is the solution everyone loves. Youtube has a Delete watched videos
feature which deletes videos you already watched. Even if you only watch 1 second of a video, it is also deleted. This is a great way to clean up your history and get rid of any unwanted videos.
What about videos we haven’t watched? We still need to find a way to delete them in bulk. So Youtube still lacks the much-needed mass delete feature. Fortunately, we can execute a JavaScript block of code to mass delete Watch Later videos.
Table of Contents
Steps to Remove All Watch Later Videos at Once
- Open your Youtube Watch List in web browsers like Chrome or Brave. Or you can access it directly by typing https://www.youtube.com/playlist?list=WL to the Address bar.
- Press
F12
to the open developer’s console or access it via the web browser’s Menu. - Navigate to Console tab.
- Paste this script into the console and press
Enter
.
Updated: 2024/05/24
Here are the scripts I used to delete videos on my Watch later list:
One of the following scripts might work for you. Try both to see which one sticks! The script was modified to work with recent Youtube changes.
setInterval(function() { document.querySelector('#contents button[aria-label="Action menu"]').click(); var things = document.evaluate('//span[contains(text(),"Watch later")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); for (var i = 0; i < things.snapshotLength; i++) { things.snapshotItem(i).click(); } }, 1000);
setInterval(function() { document.querySelector('#primary button[aria-label="Action menu"]').click(); var things = document.evaluate('//span[contains(text(),"Watch later")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); for (var i = 0; i < things.snapshotLength; i++) { things.snapshotItem(i).click(); } }, 1000);
As flud requested in the comment section, I modified the scripts to allow the deletion of unavailable videos. You must enable “Show unavailable videos” option.
setInterval(function() { document.querySelector('#contents button#button').click(); var things = document.evaluate('//span[contains(text(),"Watch later")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); for (var i = 0; i < things.snapshotLength; i++) { things.snapshotItem(i).click(); } }, 1000);
setInterval(function() { document.querySelector('#primary button#button').click(); var things = document.evaluate('//span[contains(text(),"Watch later")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null); for (var i = 0; i < things.snapshotLength; i++) { things.snapshotItem(i).click(); } }, 1000);
After pressing Enter, you will see videos disappearing one by one. When the script executes, it opens the menu of each video popup item and clicks on the Remove from Watch Later menu item.
Apply the Script in Different Languages
Thank Xerus for reporting bout the script not working in other languages. Here is how to apply it to other languages:
- Find the text of the hidden menu button (three vertical dots) by Right-click and Inspect on it. You will find the aria-label text in your language. Replace “Action menu” with the text in
'#primary button[aria-label="Action menu"]'
- Replace “Watch later” with the text in your language in
span[contains(text(),"Watch later")
French
I tried the script in the French language by replacing:
- “Action menu” with “Menu d\’actions” – Remember to add a slash (\) before a single quote to escape it.
- “Watch later” with “À regarder plus tard”
The script becomes:
setInterval(function() {
document.querySelector('#contents button[aria-label="Menu d\'actions"]').click();
var things = document.evaluate('//span[contains(text(),"À regarder plus tard")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
Spanish
setInterval(function() {
document.querySelector('#contents button[aria-label="Menú de acciones"]').click();
var things = document.evaluate('//span[contains(text(),"Ver más tarde")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
Italiano
setInterval(function() {
document.querySelector('#contents button[aria-label="Menu Azione"]').click();
var things = document.evaluate('//span[contains(text(),"Guarda più tardi")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
I was getting an error. I asked claude 3.5 to fix it. The fixed code appears to be working for me. Thank you, and cheers!
setInterval(function() {
const actionButton = document.querySelector(‘#contents.style-scope.ytd-playlist-video-list-renderer button#button[aria-label=”Action menu”]’);
if (actionButton) {
actionButton.click();
const watchLaterItems = document.evaluate(
‘//span[contains(text(),”Watch later”)]’,
document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
null
);
for (let i = 0; i < watchLaterItems.snapshotLength; i++) {
watchLaterItems.snapshotItem(i).click();
}
}
}, 1000);
Can you do one for liked videos?
anyone know how to bypass the “uncaught syntax error: invalid or unexpected token”?
:////
setInterval(function() {
document.querySelector(‘#contents button[aria-label=”Aktionsmenü”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Später ansehen”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
German / Deutsch working as of 10th of july 2024
Script that worked for me –>
setInterval(function() {
document.querySelector(‘#contents.style-scope.ytd-playlist-video-list-renderer button#button[aria-label=”Action menu”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Watch later”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
I had to make a slight adjustment to the script. Had to remove the < from inside the loop and swap it out with a < symbol which is what the < is interpreted as. This now works for me.
setInterval(function() {
document.querySelector('#primary button[aria-label="Action menu"]').click();
var things = document.evaluate('//span[contains(text(),"Watch later")]',document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
🥺 Error.
It says, “Uncaught SyntaxError: Unexpected token ‘;'”
use the following code, (3rd code block in this article):
setInterval(function() {
document.querySelector(‘#contents button#button’).click();
var things = document.evaluate(‘//span[contains(text(),”Watch later”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
If you change the 1000 of the last row to 1, it goes much faster, personally.
For some reason, it gave back the error “the string ‘//span[contains(text(),”Watch later”)]’ is not a valid xpath expression”,
so what I did was to switch between the single quotes of the expression and the double quotes of the variable, ending with this code that worked for me:
setInterval(function() {
document.querySelector(‘#contents button#button’).click();
var things = document.evaluate(“//span[contains(text(),’Watch later’)]”,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
i removed the “;” after click() and it worked for me
setInterval(function() {
document.querySelector(‘#contents button#button’).click();
var things = document.evaluate(‘//span[contains(text(),”Watch later”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click()
}
}, 1000);
can you do one on the unavailable videos section of the Watch later
You can open Watch Later section, click on the vertical three-dot menu which resides below channel description.
Click on “Show unavailable videos” menu item to show them in the playlist. Then you can execute the respective script mentioned in the post.
In Polish, po polsku:
setInterval(function() {
document.querySelector(‘#contents button[aria-label=”Menu czynności”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Do obejrzenia”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
Thank you so much finally I found a script that worked !! <3 ………………………………………………..
For Dutch:
setInterval(function() {
document.querySelector(‘#primary button[aria-label=”Actiemenu”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Later bekijken”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
Thank you so much for this, finally managed to get it cleared out.
Two things to note which might be useful for people;
– I had to change `Watch later` to `Watch Later` for it to work, it didn’t like the lowercase in the match.
– If you want to back up your watch later to another playlist, I figured out a way using a chromecast. If you play the first video from watch later and then connect to the chromecast, the whole playlist will be put into your TV queue. You can then save that to a new playlist with the + icon.
Appreciate the effort and the code. I used it and modified it to give a little flexibility on how many videos are removed each time.
I also use an extension on Chrome (User JavaScript and CSS) and save this code in the extension, so that when needed I could run this code with one command : ps_remove_from_playlist();
Link for extension : https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld
// YouTube-Playlist
// https://www.youtube.com/playlist?*
const ps_gc_scripty_outube_playlist = `YouTube-Playlist`;
console.log(ps_gc_scripty_outube_playlist);
function ps_remove_from_playlist(p_max_videos_to_delete = 50)
{
let video_count = 0;
cleanup_id = setInterval(function() {
document.querySelector(‘#primary button[aria-label=”Action menu”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Watch later”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i = p_max_videos_to_delete) {
clearInterval(cleanup_id);
}
}, 500);
}
Thank you so much, i couldn’t find any youtube videos that could help me, I tried your first script and it worked! I used this method on Google Chrome on a Macbook Air on Nov 2022. Thanks again!!
Scripts on this page didn’t work for me. I just made a script using xdtool in Linux. Works 100% whatever code Google uses or changes
This might only be a me problem, but I have 4000 videos is there any way to speed it up?
It is definitely not a you problem. I have over 4500 videos in my watch later list.
The script works at the background, so you can just let the script run and open a new tab to do other stuff (Maybe pick a few videos from the water later list to watch). The script will be done before you know it.
Hi , seems like youtube just made a change to the watch later screen . can you please update the script please. thank you
I confirmed it still works as of Nov 1st, 2022.
I used this one:
‘#contents button[aria-label=”Action menu”]’
its working , not sure why i couldn’t get it to work originally. thank you
Dutch / Netherlands / Nederlands. Works 6th October 2022
setInterval(function() {
document.querySelector(‘#contents button[aria-label=”Actiemenu”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Verwijderen uit”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
How can i modify the 1st script so it removes only a few videos. Lets say first 10?
I updated the script here:
https://tleapps.com/snippet/how-to-bulk-delete-all-youtubes-watch-later-videos-with-javascript/
it’s not working for me 🙁 keeps saying blocked by client or devtools failed to load sourcemap
Worked on waterfox, reduced the interval to 100~ and made it really quick though had to refresh the page a few times to let youtube catch up. Thanks
This worked perfectly – thank you!
Does anyone know of a current script that will delete all liked videos in You Tube?
None of those two options worked. Tried with Brave and Chrome. Can anyone update with working code?
It pulls down the action bar but doesn’t click anything.
Hi,
I’ve just tested again on Chrome.
This one works for me:
‘#primary button[aria-label=”Action menu”]’
Spanish Version
setInterval(function() {
document.querySelector(‘#contents button[aria-label=”Menú de acciones”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Ver más tarde”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
Thank you for the script. First one worked for me.
Thank you so much, you’re a god for this. The second script worked for me. I was about to accept my fate of over 1k watch later videos. For anybody having any issues, instead of F12 I did CTRL +SHIFT + J and I also turned off my adblock just in case.
ITALIANO:
setInterval(function() {
document.querySelector(‘#contents button[aria-label=”Menu Azione”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Guarda più tardi”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
Thank you so much! I had almost 3000 videos on watch later and decided to finally put a stop to it.
Thank you for this! It works great. Saved me the trouble of manually deleting 400+ videos that I’ll never get to.
You’re updated instructions worked great in Chrome (needed to run it twice somehow, but no code fiddling required). Safari somehow did not.
Did you set it to 1000 ms for bot-detecting reasons?
You’re amazing, thank you!
I believe so. I adjusted mine to 750 and it is going faster. Setting it to half a second, 500, will not work.
Your instructions were the only ones that worked so easily for me, and i’d been searching for 30 minutes how to delete all my Watch Later. thanks so much! using F12 / then going to console tab. is so much easier than the ctrl + shift + J that other people have suggested. thanks again
Script is not working more 🙁
Youtube has changed some elements. I modified the script amnd it should work now.
Can you please modify this script to add videos from a playlist to the queue?
I want to add all the uploads from a channel from the automatically generated “Uploads from [channel name]” playlist to a playlist of my own. Adding them to the queue and then selecting “Save” seems like the best option, and I would like to automate the process.
Thanks!
I will check what can be done here. If it is possible, I will create a new post to show the script.
I created the script and share on this post, https://www.tldevtech.com/how-to-bulk-add-to-queue-videos-from-a-youtube-playlist/.
did not work, but this worked
var all = document.getElementsByClassName(“dropdown-trigger style-scope ytd-menu-renderer”)
for (let item of all) {
setInterval(function () {
item.click();
var things = document.evaluate(‘//span[contains(text(),”Watch later”)]’, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
}
Worked on spanish youtube as of 4 august 2021 on my +1000 “Ver más tarde” playlist
Thanks a lot!
script worked just now.
gracias
used for almost 1000 vids though after a while it only did 100 at a time. worked again after refresh (for another 100)
thanks the script is working 29- jul 2021
Script worked for few videos but now a message apears “why seeing this add” and script shows message in red “net::ERR_BLOCKED_BY_CLIENT”. As a result videos are not being removed from list.
Thank you.
This worked for me (after I realized I was pasting the French script by accident)
Thank you thank you so much!!!! This works as of July 21, 2021!!!!
Thanks heaps! This worked like a charm, although I had to invoke the script several times after refreshing the displayed Watch Later list.
it works!
Would be important to mention that the Script works with English. If your youtube account is set in another language, you will have to replace “Watch later” in the script with the correct language first, or set your account in english and execute the script afterwards. awesome thank you
Works perfect for me. Now I have to wait 2 hours till it clears the entire list. I know I have an addiction I’m a chronic video hoarder lol.
Sorry to add more questions but, I did this, and it worked, but I didn’t know what to do after it was done. At the end I get something similar to what: FAHAD’s comment in Mar/2021. I copied this from his comment: 235VM98:4 Uncaught TypeError: Cannot read property ‘click’ of undefined
at :4:13
If you could please respond. Thanks.
What did you mean by “after it was done”? If the script worked and all videos were deleted, try refreshing your browser’s tab to stop script from executing. That error happens when there is no video to delete.
This is not working for me. I’m getting a pop up that says “Why this ad? on one line and then “Stop seeing this ad” on the second line.
Can you explain in more detail or a screenshot? What is your Youtube language, any installed browser addons for Youtube?
I get the same error. Did you ever figure it out?
doesn’t work if youtube is set to a different language :/
I updated tutorial for other language.
Neither the first nor second script is not working this error is showing
setInterval(function() {
document.querySelector(‘#primary button[aria-label=”Action menu”]’).click();
var things = document.evaluate(‘//span[contains(text(),”Watch later”)]’,document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < things.snapshotLength; i++) {
things.snapshotItem(i).click();
}
}, 1000);
1272
235VM98:4 Uncaught TypeError: Cannot read property 'click' of undefined
at :4:13
Hi. I just tested again and confirm that the script you copied works.
The 2nd script works fine, but it doesn’t delete private and deleted videos.
the script doesn work, Uncaught TypeError: Cannot read property ‘click’ of null
at :2:69
Use the 2nd script
Second script works perfectly, thank you
Hi, thank you for your reply.
Here is the image: https://i.imgur.com/JmVrnBG.png
This script hasn’t work anymore with new Youtube’s UI. I’m testing and see if I can write a new script.
Edited: I uploaded new script.
where is the script
Cannot read property ‘click’ of undefined
any ideas?
You must take a screenshot of your whole screen so I can understand what is going on.