2

This question was posted a while ago, but the answer does not work anymore as YouTube settings have changed. Plus, the answer will have your YouTube account disabled for a while before you're able to use it again.

I have found a different answer which worked for me without requiring the deletion of the channel nor deactivating it (you can use it as you're deleting). Since I am new here, I am unable to answer that question. Therefore, I am asking my own and answering it for anyone who may need it.

So to repeat the question, is there an way to bulk delete YouTube comments without deleting the channel nor deactivating it?

3 Answers 3

2

I have found a script on GitHub that deletes all comments found and loaded in:

https://www.youtube.com/feed/history/comment_history

For the script to work, the comments must be loaded first and available. So the script is essentially automatically clicking the 3 dots icon, clicking delete, then clicking delete again in the confirmation window.

The author has also made a Chrome Extension that executes the script.

To delete all YouTube comments:

  1. Download Erasure.
  2. Go to https://www.youtube.com/feed/history/comment_history
  3. Press and hold "End" key on the keyboard until the page stops loading any comments.
  4. Click Erasure icon and "click to delete all comments"
  5. Wait for the script to finish.

More information on the matter:

  1. I deleted 10 years worth of comments in 30-40 minutes. So it will take time depending on your internet connection speed and your computer speed.
  2. You may need to repeat the steps since some YouTube comments are not instantly deleted (like those on unavailable/private videos).
  3. It takes a bit of effort, but it works and you will be able to use your account even during the operation (make sure you use a different Chrome window).

I hope this helps someone as it helped me.

1
0

A little late to the party but this is my solution for 2022:

function scrollDown(i) {
  try {
    window.scrollTo(0, document.body.scrollHeight); 
  }
  catch (e) {
    scrollDown();
  }
  setTimeout(function(){
    var i = i - '20'; // just to make sure we dont skip any comments while scrolling
    deleteComment(i);
  }, 1000);
}

function deleteComment(i) {
  
  var xPathRes = document.evaluate ('/html/body/c-wiz/div/div[2]/c-wiz/c-wiz/div/div[2]/div[1]/div', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; 
  if (xPathRes) {
    if (xPathRes.textContent == "Looks like you've reached the end") {
      console.log("All done! Keep the page open until everything is gone including the grey date bubbles");
      return;
    }
  }
  
  console.log('Deleting comment: ' + i);
  
  var xPathRes = document.evaluate ('/html/body/c-wiz/div/div[2]/c-wiz/c-wiz/div/div[1]/c-wiz[' + i + ']/div/div/div[1]/div[2]/div/button', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
  
  var i = i + 1;
  if (i > 500) {
    return;
  }
  
  try {
    xPathRes.singleNodeValue.click();
  }
  catch (e) {
    scrollDown(i);
    return;
  }
  
  deleteComment(i);
}


deleteComment(1);

!! Be aware that this script is not perfect. I coded it in a hurry. If the script didn't delete everything, just paste it again and keep the page open untill everything is gone (it takes a while to process all the requests)

The script will halt after it sees the "looks like you've reached the end".

This script works on: https://myactivity.google.com/page?utm_source=my-activity&hl=en&page=youtube_comments

0

Bulk/Auto Delete youtube comments through the browser console https://myactivity.google.com/page?&page=youtube_comments

the code:

c=[];
for(i in e=document.getElementsByTagName('path')){
    typeof(x = e[i])==='object'? x.getAttribute('d').includes('6.41z') ? c.push(x.parentNode.parentNode):e:e;
}
setInterval(()=>{
    c[0].click();c.splice(0, 1)
}, 3000);

Here's how it works if anyone cares

c=[];//gonna be used to store the buttons

for(i in e=document.getElementsByTagName('path')){

    //this grabs the grandparent element of <path d="6.41z"> tags because theres a million ways to get the "delete comment" buttons and I was bored
    typeof(x = e[i])==='object'? x.getAttribute('d').includes('6.41z') ? c.push(x.parentNode.parentNode):e:e;
}

//this regulates how fast the comments get deleted. if you try to delete too many at once, only so many will actually delete before you have to reload the page and do it again
setInterval(()=>{
    c[0].click();c.splice(0, 1);
}, 3000);

Google throttles how fast you can delete the comments since one of the updates a while ago so it's set to delete 1 comment per 3 seconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.