Next article: Serbian Tragedy
Previous article: Mutterings for October 31
Over the last two days, I have been hit with over 200 hits of comment spam. (That’s what being number one for “spooky car ad” will get you.)
At one point, I had 133 bogus comments awaiting moderation in my queue, so I started working on a bookmarklet to mass select every delete button on the page. I didn’t get it working until after I had to select “delete” for each of those 133 comments by hand, but I did get it working.
Here it is: Mass Delete.
It will cause every “delete” button on the page to be selected, so use it with care. It has only been tested on Firefox 1.0PR; your mileage may vary.
If you are running your own server, may I also suggest Apache and mod_security?
The URL to trackback this post is:
http://kevinbasil.com/2004/11/01/mass-delete-bookmarklet/trackback/
Copyright © 2002–2011 Kevin Robert (Basil) Fritts, all rights reserved.
November 1st, 2004 at 10:15 am
Or you could just use Spam Delete, which is platform independent. The bookmarklet is great until you get hit with 600+ at a time as I have had in the past. At that point it is easier to just hit the DB and delete them.
Spam Delete allows you to delete an unlimited number of comments in one button click. Take a look.
November 1st, 2004 at 5:18 pm
OK, so I put that in my plugins directory. Then, I pull up the plugins page, and there is “Chris’s [sic] Easy Mass Delete” on one line and a blank line above it. When I activate “Chris’s Easy Mass Delete,” nothing happens. When I activate the somewhat disturbing blank line with nothing at the end, I get a fatal error when I pull up my edit.php page. Error reads: “Fatal error: Call to a member function on a non-object in [~]/blog/wp-includes/wp-l10n.php on line 37”
Looking at the code, it looks mostly useful when one of two conditions obtain:
1. I have spam that has gotten past the filters, or
2. I have good comments in the moderation queue along with the spam.
Neither condition obtains very often for me, though I’m probably jinxing it by saying so. The bookmarklet is a 2-3 keystroke client side version of what the plugin does with PHP. It simply checks every “delete” radio button in the moderation queue. You click “Moderate Comments,” and they are gone.
Of course, that’s not very helpful if you put every comment into the moderation queue.
November 1st, 2004 at 6:38 pm
Did I mention I would jinx it? Bah.
November 2nd, 2004 at 11:17 pm
As I said above, that is fine and dandy until you have 600+, you can’t very well have all 600+ comments listed on one page can you? No of course not. Then you have to delete page of comments by page of comments until you work your way through all of them.
And as the description text for the plugin states in the plugin manager: “Allows you to easily delete large numbers of comment spam. This plugin allows me to insert a new menu item, there is no other reason for it.”
That would mean that all the plugin does is add the menu item to allow you to access the admin screen cjd_delete.php which should be in your wp-admin. You might not have known that since you Dled the package directly instead of going to the site and DLing where there were comprehensive instructions.
As for the blank line, not my doing. Not sure what is going on there.
November 3rd, 2004 at 5:44 am
Sure, you can have 600+ one page. If you can have 135 on a page, why not 600? They both make for long pages.
A link to your “comprehensive instructions” would be kind. I downloaded from the link you provided. Including instructions in the zip package in a readme file would also be instructive.
November 5th, 2004 at 7:36 am
OK, I found your “comprehensive instructions.” The files have been renamed from
mass_delete.php
andmass_delete_ph.php
tocjd_delete.php
andcjd_delete_menu.php
.Including similar instructions with your download would be considerate and standard practice. Especially if you’re going to throw out links directly to the .zip file.
Here’s what I’ve gotten so far, after reading the post:
I moved
cjd_delete.php
into my/wp-admin/
directory, and leftcjd_delete_menu.php
in my/plugins/
directory. The blank line is no longer there; so, blank line on the Plugins page means the hack is in the wrong directory.I’m not getting a menu item, though. It’s not at the top, and it’s not on the edit page. If I access
/wp-admin/cjd_delete.php
, the page comes up fine.