Read the update, this has been put in the latest version of Spam Karma!
One of the changes in WordPress 1.5 is that comment spam isn’t actually deleted when encountered by the built-in anti-spam measures, it is silently stored in your database and marked as spam. It won’t ever show up on your blog or in the interface, but it is there if you need it.
Spam Karma is the best 3rd party anti-spam tool for WordPress. When Spam Karma encounters obvious spam, it deletes it. Why not keep that spam in the database, marked as spam, as WordPress 1.5’s built-in anti-spam measures do? The benefits of this are twofold. First, if a legitimate comment gets caught by Spam Karma, you can easily restore it, as it is still in the database. Second, future versions of Spam Karma or WordPress may make spam decisions based on the known spam you have stored in your database, so eventually this could increase your blog’s ability to recognize spam.
The first change you need to do is in Spam Karma. In the Spam Karma plugin file (/wp-content/plugins/spam-karma.php
) delete this line (it is line 2173 in SK 1.19 alpha 1):
$wpdb->query("DELETE FROM {$wpdb->comments} WHERE comment_ID = {$comment_ID} LIMIT 1;"); // kill the nasty bugger...
In its place put this:
$wpdb->query("UPDATE {$wpdb->comments} SET comment_approved = 'spam' WHERE comment_ID = {$comment_ID} LIMIT 1;"); // save as spam
Save the file and upload it to your server.
Now, for restoration of false positives, you need a way to access comments marked as “spam” from within the WordPress interface. This capability comes via an excellent plugin from ColdForged called the Paged Comment Editing Plugin. Drop this little beauty into your plugins folder and activate it. Now, by going to Manage -> Comments in the WordPress interface, you will be able to display comments marked as spam by clicking “Only Spam.” To restore a legitimate comment that was erroneously marked as spam, click “Edit Comment” and change its status to “Approved.”
Mmm… spam leftovers.
Update: I put this hack, as well as several fixes for full WordPress 1.5 compatibility into a new version of Spam Karma, and it is now available. Go get it! Note that the Cold Forged plugin is still of use for “undeleting” comments.
Rob says
Hey, that rocks. And I was even able to do it myself. Pulling accidentally deleted comments out of the spam karma digests was a pain. Now its easy.
I really like the paged comments plug-in. My site can sometimes get 100+ comments over night. Going back to find one that needs to be edited was a pain.
One question though, Mark. In my installation I have a plugin called “Staticize Reloaded” that is deactivated. Should that be activated?
Mark says
Nah, Staticize Reloaded won’t work properly with your install without a lot of tweaks, and I don’t think the benefit is worth the trouble in your case.
Rob says
Ok, I was just curious.
ColdForged says
Mark you left a comment a couple of days ago on my site that I responded to but haven’t heard back from you. So I’ll come to this side of the pond and bug you :). You said:
To which I responded:
Help a brother out?
Mark says
Hm… it seems that it is, in fact, related to the bug in 1.5. So you should probably wait until 1.5.1 before you change anything. I love a lot of the features of 1.5, but it seems like it was rather rushed, with code added the night before and all. Eh, 1.5.1 is looking good.
ColdForged says
True dat. Which plugin was it, by the way, just so I know?
Geof F. Morris says
Sweet work, Mark. Thanks for the assist.
ian says
This is awsome. Details about 1.5 plugins. These are difficult to find. Thanks!
Sjd3t says
http://shivery.bravehost.com/treasure-valley-community-college.html treasure valley community college [link=http://shivery.bravehost.com/treasure-valley-community-college.html]treasure valley community college[/link]
bbslnu says
car news nissan