There are a ton of ways to stop spam on blogs. This is my dirty (and not pretty) solution that I am adding to stop the recent wave of crap that is getting through the front end checks.
The long term plan is to put a back-end on this but for now here is v.00001
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org <!--- Seperate with a pipe "|" as this is a regex list --->
<cfset commentBlacklist = "coachoutletmall|wowgold" />
<!---
All the fields that we are going to check.
Don't really need to check the email field as its not displayed.
--->
<cfset checkFields =trim(form.name) & trim(form.email) & trim(form.website) & trim(form.comments) />
<!--- reFind to check the fields as they are past the other rules i.e. captcha --->
<cfif reFindNoCase("#commentBlacklist#", checkFields, 1) >
<cfoutput>Sorry deadbeat, I don't allow comment spam. If you feel you were wrongly blacklisted
<a href="http://www.andyjarrett.com/blog/page.cfm/Contact-Me">Contact Me</a>
</cfoutput>
<cfabort>
</cfif>1<!--- Seperate with a pipe "|" as this is a regex list ---> 2<cfset commentBlacklist = "coachoutletmall|wowgold" /> 3<!--- 4All the fields that we are going to check. 5Don't really need to check the email field as its not displayed. 6---> 7<cfset checkFields =trim(form.name) & trim(form.email) & trim(form.website) & trim(form.comments) /> 8<!--- reFind to check the fields as they are past the other rules i.e. captcha ---> 9<cfif reFindNoCase("#commentBlacklist#", checkFields, 1) > 10<cfoutput>Sorry deadbeat, I don't allow comment spam. If you feel you were wrongly blacklisted 11<a href="http://www.andyjarrett.com/blog/page.cfm/Contact-Me">Contact Me</a> 12</cfoutput> 13<cfabort> 14</cfif>
n.b. If you are on BlogCFC then this is for addcomment.cfm
Nice. FWIW, if you're on BlogCFC then you already have access to CFFormProtect, which has the option to incorporate both Akismet and Project HoneyPot, both of which offer outstanding Spam control. Once I got those implemented on my blog my Spam comments went to virtually zero.
@sid Glad you found it! I should of been clearer :)
@Eric You know what, I had an after thought that it might when I was adding this snippet of code. I'll have a look in to that later! Cheers for the tip!
BlogCFC not only supports cfformprotect, but also basic keyword matching. When I turned on cfformprotect and enabled akismet/honeypot, it became near perfect. :)
@Andy - Yeah I knew where the file was - was just wondering where IN the file I needed to put it - but as usual with Ray's code - I found it quick enough once I looked...
I have a (FOSS) solution that takes pretty much the same approach but is a bit more robust. Also, you can take advantage of updated spam definitions (I try to update them at least once a month) by just reinitializing BlogCFC.