IDblog ... an information design weblog

October 11, 2003
Fighting comment spam

I've been intrigued by the relevance of the double-edged sword as a metaphor in life, particularly regarding technology. Everyone's on the Internet? Big yeah! But now we have millions of computers that have security holes you can fly a 747 through. Yikes.

Similarly, I've been enjoying blogs both as a reader and an author for years, but now I'm being forced to deal with the dark side of it--spam via blog comments. Yuck!

Over on Brainstorms and Raves, there's a great summary of the problems and potential solutions for dealing with unwanted comments. I've gone ahead and implemented the "Screen Your Comments" option (i.e., comment moderation) for IDblog.

So, my apologies to my readers, but I'm getting really tired of deleting porn spam from my comments. Since I think the universe of spammers is much larger than the universe of IDblog commenters, I'm choosing to moderate the comments rather than try and keep up with blocking the spammers.

Check out the extended entry if you want to read more of the technical details.

The solution I implemented involves two different authors/plug-ins and instructions from a third. Here is what I did to install this for the first time on IDblog, which is Perl-based and uses the Berkely db format (see scriptygoddess if you want comment moderation but use PHP and MySQL).

Here are the steps:

  1. Make a backup copy of your blog entries by exporting them from the MT menu (listed in left-nav under UTILITIES). Better be safe than sorry...and it only takes a minute or two.
  2. Download the following two scripts/plug-ins and install in your MT script directory (where mt.cgi lives): Make sure that these files have the right permissions (775, o:rwe, g:rwe, w:re).
  3. Make this edit to your Comments.pm file (note the plural Comments). This file can be found in YourMTFolder/lib/MT/App/:
    This will make the script work with all blogs in your MT install.
    Change this line (If you have trouble finding the line - do a search to find it):
    
        $comment->entry_id($q->param('entry_id'));
    
    to:
    
        $comment->entry_id('0');
        $comment->temp_entry_id($q->param('entry_id'));
    
    If you don't want to make this change to all your MT blogs, see step 5 in the instructions for the Scriptygoddess version of this hack.
  4. Make this edit to your Comment.pm file (note the singular Comment). This file can be found in YourMTFolder/lib/MT/:
    Change this line:
    
     'id', 'blog_id', 'entry_id', 'author', 'email', 'url', 'text', 'ip'
    
    to:
    
     'id', 'blog_id', 'entry_id', 'temp_entry_id', 'author', 'email', 'url', 'text', 'ip'
    
    
  5. Test the script functionality by going to the URL Your_blog_URL/mt-comments-pending.cgi (i.e., take your MT login URL and change mt.cgi to mt-comments-pending.cgi).
  6. Go to the template that includes your comments form (if you have in-page comments, that is probably the individual entry archive template). Add some language that alerts comment submitters that you will be moderating comments so they don't stress out when their comments don't appear immediately.
  7. If you haven't already, update your Comment Configuration (under Preferences, see weblog config under MANAGE in your MT left-nav) so that you are notified via email when someone posts comments to your site.

Update: This is the code I now have to do the recent comments section on the home page. Alas, "unapproved" comments don't appear in the specific blog entry post, but they are showing up via the tag:




This breaks when folks use things like a carriage return or single quote (like in "don't") in their comment. But I don't really want to go back to listing just the entries. Too bad I never did get up-to-speed in javascript, but I'll try and figure this out when I get a chance.

Comments

Hi, I'm so sorry to hear about your comment spam problem. It sounds like you've got a good approach for your site worked out.

Thanks also for the kind comments and link to my post about the comment spam.

I hope all is going well for you. :-) Take care.

-- Posted by Shirley Kaiser on October 12, 2003 01:06 AM
Post a comment
Note: Your comment will be reviewed prior to posting to minimize comment spam. Management regrets the inconvenience!


IDblog is Beth Mazur tilting at power law windmills. A little bit Internet, a little bit technology, a little bit society, and a lot about designing useful information products. Send your cards and letters to .

search this site
archives
categories
key links
groups
about moi
feeds
amphetadesk
rdf
xml
gratuitous right-nav promos


(pdf)




Creative Commons License; click for details

Powered by Movable Type