Akismet is an external antispam detection service, and it is standard for WordPress.com.
There's a module which makes is possible to use Akismet service with Drupal.
Installation of the Akismet module
Installation is just like any other Drupal modules. Download the Akismet module from the project page at Drupal.org.
Akismet module
http://drupal.org/project/akismet
Actually, the Akismet module is not actively maintained now, and it has some compatibility issues with Drupal 6.x. So if you are using Drupal 6.x, you may not be able to use Akismet module as it is unless you applies some patches.
We have developed the new Drupal module, AntiSpam module based on the Akismet module. Please see the following pages for more details.
AntiSpam module (@ Drupal.org)
http://drupal.org/project/antispam
AntiSpam module documentation
http://www.pixture.com/drupal/node/76
Obtaining an Akismet API key
Akismet API key can be obtained free of charge by signing up a free account at WordPress.com. Once you get a free account at Wordpress.com, you can also get a free email address and your blog space too, but you do not really have to use them. You can find your Akismet API key in the email automatically sent from WordPress.com once the registration is done.
WordPress.com free account sign-up page
http://wordpress.com/signup/
In case if you use Akismet for the commercial site or for the personal site of which revenue is more than $500/month, you are required to obtain a commercial API key at the Akismet site.
Akismet commercial use API key
http://akismet.com/commercial/
Setting up Akismet
Once you get the API key, copy and paste the API key from the email to the Drupal Akismet module settings page at [drupal-root]/admin/settings/antispam
At this settings page, you can set various options. When you first use the Akismet module, leave them as it is, and you can come back and tune your Akismet module later. However, if you are not the only one who can post an article(node) and there's a possibility that someone can post a spam as an article, then you may want to enable the spam detection of nodes at Node Options section.
Testing the Akismet
Log out from your site and then try to post some spam comments to your article to see what's going to happen. As default, there's one minute delay when Akismet determined the post as a spam. So you may need to wait for one minute until you can do the next action. This delay is for preventing spambot from sending a large number of spams to your site continuously. You can change this delay time at the settings page.
If a comment is determined as a spam, the comment is not published and automatically put in the moderation queue. Akismet module can delete the comment in this moderation queue automatically after the specified period has expired. You can set the expiration period at the settings page.
Akismet moderation queue
Akismet moderation queue let you view the summary and list of the messages(nodes/comments) and manage them. You can apply the following operations to multiple messages in a batch:
publish, unpublish, delete, report false negative (submit as spams), report false positive (submit as hams)
You can see the extract of the message body when you move the mouse over the message title. This helps you to determine if a message is spam or ham easily.
Customizing comment display
In this section, we shows how to make it easy to manage comment spams by customizing the theme. Below is the sample screen shot of what we explains here. As you can see, the comments which are determined as spams are in dark color with big X mark.
When you enable the Akismet module, it adds "Submit spam" or "Submit ham" link to the link section at the bottom of each message. These links make it easy to fix the incorrect determination by Akismet. When you click either one of these link, the information is sent to Akismet so that Akismet can learn from its mistakes. This operation will improve the accuracy of the Akismet service, so please take some time once in a while and check to see if there's any false determination. The theme customization we show here would help you to do this more easily.
Here's how you can apply different color (or background image) on spam messages.
-
First off, open the comment.tpl.php of your theme by an text file editor. It should shows like this:
Then, modify the top part of this file where it defines the DIV element to a comment.- <?php
- // $Id: comment.tpl.php,v 1.10 2008/01/04 19:24:24 goba Exp $
- ?>
- <div class="clear-block">
- <?php if ($submitted): ?>
- <?php endif; ?>
akismet_content_is_spam() is a public function of the Akismet module, and it retuns if the message is determined as a spam or ham.- <?php
- // $Id: comment.tpl.php,v 1.10 2008/01/04 19:24:24 goba Exp $
- ?>
- if(akismet_content_is_spam('comment', $commend->cid))
- }
- ?>">
- <div class="clear-block">
- <?php if ($submitted): ?>
- <?php endif; ?>
By using this function, you can add comment-spam class to the DIV element of the comment which is determined as a spam.
- Next, edit the style sheet (style.css) of your theme and specify the background-color/border/background-image.
That's all. Easy isn't it?! Besides, only the administer of the site can see these colorized spam comments since they are unpublished.
