Approve all your blog comment using javascript magic

I usually check and reply all my blog comments on friday night and approve the spam comments. Last friday I was checking my spam comments and saw that there was almost more than 70 comments and I thought approving all comments will be a hectic process and I was thinking of a process that I can do it with one click. Then I came up with the solution of writing a JavaScript script to approve all comments.

Here below the script –

var x = document.getElementsByClassName('comment__action comment__action-approve');
for (var i = 0; i < x.length; i++) {

The above code actually select the approve button and gives me an array then x[i].click(); this will click each approve button one by one.

Thank you 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s