Stop comment and contact form spam with Mollom in Drupal

Mollom web service A couple of month ago I wrote Stop comment spam with Akismet and captcha in Drupal. Now I have switch to Mollom.

The main reason is that the Akismet module maintainer says it’s “pretty unsupported at this point” and I’m planing to soon upgrade xdeb.org to Drupal 6.

Mollom is similar to Akismet, it’s a web service where post get analyzed to see if they are spam or not. One of the founders of Mollom is Dries Buytaert, also the founder of Drupal. That of course means it has solid Drupal support via a Mollom module.

Mollom has it’s own capacha that is only shown when it’s suspects that the content is spam. Mollom can also check not only comments and nodes but contact form submissions as well. These are all things I think is improvements over Akismet with Drupal.

The one thing I miss from the Akismet module is the quick links to publish/unpublish and spam/ham content. Both services seems to me equally good at catching spam but I have only tested them here on my own blog so that doesn’t say much.

I have set Drupal not to require previews for comments. Authenticated users on xdeb.org get live previews via the Live module. I have then added the following code under a hook_form_alter() that removes the “Post Comment” button from the initial comment form for users without the “post with no checking” permission. This way anonymus users must preview (stops a lot of spam also for some reason, maybe they are lazy :-).

    case 'comment_form':
      // Force users with no "post with no checking" permission to always preview.
      $op = isset($_POST['op']) ? $_POST['op'] : '';
      if (isset ($form['submit']) && !user_access('post with no checking') && $op != t('Preview comment') && $op != t('Post comment')) {
        unset($form['submit']);
      }
      break;

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • No HTML tags allowed
  • Lines and paragraphs break automatically.

More information about formatting options

Syndicate content