Deleting spam comments in .Text

They hit from time to time, slapping their advertisements for online poker or other vices on our .Text blog sites. You can go through the admin console and delete them one at a time, or you can do it from SQL.

delete from blog_content
where parentid <> -1
and title not like 're:%'

That’s a pretty reliable way to purge them — provided your legitimate comments use the default subject line that starts as a reply to the original blog title. You can further filter things down by using a date range, which is useful if you know you were slammed between a few days and don’t want to take the risk of touching anything outside that date range.

delete from blog_content
where parentid <> -1
and dateadded between '2005-06-01' and '2005-06-30'
and title not like 're:%'

Damn spammers…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.