Helping people with computers... one answer at a time.

"Comment Spam" places links to spammers websites in the comments of blogs around the internet. There are various techniques to combat it.

How do I stop comment spam in my blog?

I almost titled this entry "What does a porn site have to do with Ask Leo!" because I was getting regular comments that were nothing more than attempts to post a link to porn sites. Naturally I removed them as soon as I was notified about each but that's time consuming and annoying. It was easy to see that the comment spam was machine-generated because the posts were extremely similar right down to bad grammar and misspellings.

I had one technique in place for some time but it was still allowing this class of spam to get through. Time to break out some bigger guns.

For the record, Ask Leo! is powered by Movable Type so the techniques I'm outlining here are specific to that.

My first attempt some months ago was simply to rename the comment addition script from the default name used by Movable Type. That actually worked very well until just recently. I had been getting several bogus comment posts per day and they simply went way for some time.

Recently though, I started getting more porn posts and decided to go for a solution I had seen on several of my friends blogs: the use of a Captcha Turing Test. You've probably seen them, you're presented with a graphic that contains a somewhat obscured number or word and you are asked to re-type what you see. This is intended to "prove" that you're a real person and not a computer because presumably a computer running an automated spam-bot could not read the text in the graphic.

James Seng has in fact created a Captcha Turning Test for Movable Type called SCode. Installation proved to be a bit of work so it's possible that this is not for the weak of heart. In my case I needed to upgrade a graphics library on my server which involved downloading, rebuilding and installing that library, and then rebuilding SCode and installing that. Then when all that seems to be done all of the comment templates needed to be altered to include the actual test presented to commenters.

It was a bit of work but it appears to be working. I'll still delete inappropriate posts but at least number of those should decrease dramatically.

If this solution seems a bit daunting for you then perhaps a visit to is in order. They have a number of solutions for preventing spam on Movable Type and other content management systems.

Article C1903 - March 10, 2004 « »

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Benjamin Lindelof
November 12, 2004 4:57 AM

You website rates high in Google! There are other sites that answer questions and allow anyone to post responses, but why do you think your site is ranked so high?

I think it's because of your use of standard HTML pages so Google can index your pages easily.

Does Movable Type export HTML files or generate them dynamically? Thank you!

November 12, 2004 9:55 AM

I think it's because I've paid some attention to some simple things, and haven't tried to "game the system". Yes, MT allows a lot of control over the HTML it generates, and I did invest some time there.

Jenie william
July 15, 2005 4:35 AM

I am also suffering from spamming but there is no any successfull way to solve this problem.

Ren Jonsin
July 12, 2006 2:24 AM

I use Textpattern for my site, and haven't had the problem of comment spam yet. I've seen a couple of casino sites show up, but the software automatically hides it because it recognizes it as spam. Also, since it's not as widely used as MT or Joomla, it isn't a target for spammers as often I've been told. That, and it's multiauthor support, were the main reason I chose to use Textpattern.

Another trick is to cut off commenting after two weeks. Many of the spammers don't care if humans see the links really, only if search robots do.

July 14, 2006 8:36 PM

Spammers never cease to amaze me. I've been on the net a long time and have become pretty much immune to all kinds of advertisments.

Don't these spammers who create the bots realize that:

A) 90% of blogs aren't high traffic


B) Anyone with half a brain in their head knows its spam just by looking at the URL

I think the main thing that pisses me off with blog spam is the fact that many blogs are people's personal websites (like mine) on which we don't display ads because we choose to just have the "meat and potatos" on our pages. Then some idiot comes along and wants to put their adverts on our site for free.

Anyhow I've been using Wordpress for many of my websites for a while now. I believe WP and MT and made by the same company.. Anyhow WP has a neat plugin called Ankiset (sp?) anti-spam which works very well. Maybe MT has something similar.

Mighty Matt
November 1, 2006 10:19 PM

Many of the spammers aren't interested in getting people off your site and onto theirs. What they're actually trying to do is increase their sites ranking in search engines (like Google) which rank on number of incoming links from other sites.

June 25, 2007 2:29 PM

you should also check out pretty sweet and barely anything to install.

October 4, 2007 3:19 AM

After using Captcha, there seem to be a certain decrement in spam messages that i used to receive regularly. And the news about the Update of Captcha is also quite pleasing one, because i too found some loopholes in the previous version and was concerned about those too. I hope that the mistakes would have been identified and being removed. In the whole i have been busy in looking some useful websites regarding Anti-spamming solutions and i would like to share the site that i found most useful.
After going through this web, youll certainly find it worth full to be shared.

Frank Bruno
February 20, 2008 9:48 AM

I stopped all my comment spam for my Wordpress blog by using "Comment Bot Nuker". All the other plugins I tried for Wordpress only holds the comment spam from moderation. I tried them all even the "add math" and Askimet. Most all the comment spam you will get is actually from the bots that scour the Internet looking for security breaches. Using Comment Bot Nuker it nukes the comments before it is even held for moeration and lets the good comments through. So there is nothing to moderate. I don't have to go through hundreds of comments held for moderation anymore. I foudn it here:

Mark Debattista
April 15, 2009 1:15 AM

Yeah comment spamming is an issue even nowadays. I'm using Akismet on my SEO blog Malta which seems to do the trick.

February 4, 2010 2:25 AM

Well, if you use wordpress the best thing you can do is to install a plugin that stops spam. Well, it is called Akismet and you can find him among wordpress files, but after installation you have to activate it. For more info on this you can check

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to to ask your question.