Cleaning out comment spam in Typo

Posted on Friday, May 19, 2006 in Uncategorized

It would appear that this site has become a target for comment spam. This has happened before, but I just cleaned it up (see below) and forgot about it. However they hit me even harder this time, so I decided to make some changes.

From now on, comments will be automatically disabled after 14 days. This may be reduced in the future.

Cleaning Up

Fortunately for me, the spam is all created in a certain time frame (usually greater than 14 days, hence my chosen cutoff period) and because my site is very low traffic these days, I’m confident that simply dumping all comments created during that period will only hit a minimum of real commentary. I could be more specific in my target period (e.g. determine the timestamps of the first and last comment), but I’ve foundthe below Postgresql query to be good enough for my needs. YMMV.


delete from comments where date_trunc('day', created_at) = date_trunc('day', current_date - n);

Where n is the number of days since the spam was created (easy to spot in the Typo admin view).

Related posts:

I hate spam Not so long ago I boasted about how good it... Why developing your own blog software isn’t always a good idea David Goodwin made the following comment on my post about... Typo Annoyance I’ve found a very annoying feature of Typo: When you... Typo & Ruby on Rails It was my intention to upgrade my weblog software at... Running Typo svn on Debian Stable (Sarge) After numerous attempts to upgrade this site to the latest...

Related posts brought to you by Yet Another Related Posts Plugin.

My music selection makes last.fm look good

cd cover

This theme was designed by Chris Wallace and is licensed under the GNU General Public License.

Check out his cool WordPress Themes. Released by Six Revisions in the year of the rat.


Mobilized by Mowser Mowser
Mobilytics