Cleaning out comment spam in Typo
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).
About this entry
You’re currently reading “ Cleaning out comment spam in Typo ,” an entry on schwuk.com
- Published:
- 5.19.06 / 11pm
- Category:
- Uncategorized
Comments are closed
Comments are currently closed on this entry.