Skip to main content
Participating Frequently
July 28, 2006
Question

How to delete Messages with Certain Word

  • July 28, 2006
  • 1 reply
  • 278 views
Hi, I've been getting a lot of spam lately from my comments form. My comments are stored in a DB. The problem is the spam keeps coming every day and sometimes they come in tens and hundreds. This is really frustrating and irritating. I am thinking of putting a CFQUERY on my application.cfm file that searches for spam in my comments (basically, those entries that have lots of <h1> and <http> and [url] words in them. And if there are such comments, they are immediately deleted from my database.

Does anyone give an example how I can do this? Or does anyone have a better solution to this?

Thanks! Any help is appreciated.
This topic has been closed for replies.

1 reply

Inspiring
July 28, 2006
To delete records that are already there.

delete from mytable where somefield like '%http%'

For day to day stuff, instead of inserting and deleting, just don't insert it.