Picture of a lake in Canada

Removing all BlogEngine.net Comments with JavaScript

February 10, 2012 , posted under javascript quick fix

I have had quite a lot of spam on this blog, but never got round to clearing it all out. I couldnt find a function that would let me remove all of the comments from all of my posts so I wrote a little bit of javascript to automate the process.

Using Chrome’s inspector and script console run this line of code on your comments page. 

setInterval(function(){ 
    $(".chk").attr('checked', true);
    ProcessSelected('Delete', 'Pending'); 
}, 800);

Replacing ‘Pending’ with ‘Approved’ if you need to clear out those as well.

There may well be a better way of doing it but for me this worked just fine.

comments powered by Disqus