Comment Moderation – Select all for delete
My spam words list is pretty good and has been catching almost all spam (and very few "legitmate" comments) – however, my complaint has been that the moderation page makes you manually select under each and every comment, the delete "radio" button. If a lot of comment spam has been thrown into moderation, I want an easy way to "select all for delete". So I wrote a little javascript that you can add to your moderation.php page (in wp-admin folder) (yes, sorry, core wp file editing – if you have another way – suggest it) that will auto-select the "delete" radio for all comments on the moderation page.
Open moderation.php and either search for the following line, or look for (what should be) line 143:
<?php _e('<p>The following comments are in the moderation queue:</p>') ?>
And add this below that line:
<script language="javascript">
function doIt()
{
for (var i=0; i< document.approval.length; i++) {
if (document.approval[i].value == "delete") {
document.approval[i].checked = true;
}
}
}
</script>
<p><a href="javascript:doIt()">Select all for delete</a></p>
I've tested it on Firefox and IE6 on a PC.
July 1st, 2004 at 4:27 pm
January 12th, 2005 at 7:39 pm
July 1st, 2004 at 4:10 pm
Scriptygoddess continues to post numerous WP-related fixer-uppers with three new offerings:
Adding content to the spam list
Delete all comments via moderation
Add a 'remember me' option on login page
David Raynes posted his latest MT …
July 7th, 2004 at 6:29 pm
Comment moderation for WordPress…
October 31st, 2004 at 10:02 am
I just ran across this tip. Thanks! It's just the trick I need!
Now if I can figure out why I can't get comment moderation to turn back off…
November 6th, 2004 at 7:03 pm
Danke. Now what I need is to set it so banned words in combo with url's bring the user back to comment form with a message instead of putting the comment in the queue.
December 4th, 2004 at 9:45 pm
Thanks — this works well with Safari, too!
January 7th, 2005 at 11:19 pm
You ARE a goddess!
I wish I would have looked for this sooner…THANK YOU!!!
January 24th, 2005 at 6:50 pm
Thank you! Works wonderfully!