2

Is there any way to delete all my YouTube comments from here https://www.youtube.com/feed/history/comment_history at once?

1
  • If you don't mind, you can write a rather simple script for doing that. Apr 22, 2018 at 18:04

2 Answers 2

1

If you hide and then unhide your channel, all your comments and replies to comments will get deleted.

Note that this feature is sort of buggy, so while it states your subscribers will get restored when you unhide it, it can take an awkwardly long time until that actually happens.

1
  • Or you can just post some nasty comments that violate the TOS and they'll take the liberty of doing it for you (or even if you don't actually violate the TOS ¬_¬).
    – Synetech
    Oct 31, 2021 at 0:36
0

A little late to the party but for those that look for a solution in 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

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.