scriptygoddess

30 Jun, 2004

Comment Moderation – Select all for delete

Posted by: Jennifer In: WordPress Hacks

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.

9 Responses to "Comment Moderation – Select all for delete"

2 | EDaPina DTUP » Hack para wordpress

January 12th, 2005 at 7:39 pm

Avatar

[…] nes viejas de WP y no han tenido (o no han querido) actualizar su versin de WP pueden leer este post el cual les permitira agregar un […]

3 | Code Novice

July 1st, 2004 at 4:10 pm

Avatar

Bookmarks: MT, WP and Moneymaking Blogs
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 …

4 | Mama Write's Sideblog

July 7th, 2004 at 6:29 pm

Avatar

Comments Moderation
Comment moderation for WordPress…

5 | loid

October 31st, 2004 at 10:02 am

Avatar

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…

6 | SEO News

November 6th, 2004 at 7:03 pm

Avatar

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.

7 | Mariann

December 4th, 2004 at 9:45 pm

Avatar

Thanks — this works well with Safari, too!

8 | Beth

January 7th, 2005 at 11:19 pm

Avatar

You ARE a goddess!
I wish I would have looked for this sooner…THANK YOU!!!

9 | Ampersand

January 24th, 2005 at 6:50 pm

Avatar

Thank you! Works wonderfully!

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements