scriptygoddess RSS Feed
 
 
 
 

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.

9 Responses to “Comment Moderation – Select all for delete”

  1. 1
    Weblog Tools Collection » scriptygoddess >> press all for delete:
    [...] ss all for delete Filed under: WordPress Hack LinkyLoo — Mark @ 12:27 pm scriptygoddess >> Select all moderated comments [...]

  2. 2
    EDaPina DTUP » Hack para wordpress:
    [...] 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. 3
    Code Novice:
    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. 4
    Mama Write's Sideblog:
    Comments Moderation
    Comment moderation for WordPress…

  5. 5
    loid:

    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. 6
    SEO News:

    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. 7
    Mariann:

    Thanks — this works well with Safari, too!

  8. 8
    Beth:

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

  9. 9
    Ampersand:

    Thank you! Works wonderfully!

Categories

Archives

Bookmarks

WordPress Resources

Meta

ADVERTISEMENTS