Comment SPAM – again…

The easiest way to block comment SPAM is to turn of comments altogether. Another way is to turn of comments to existing posts periodicly which is the way I do it (using a cron job). I’m running Pebble for my blog so disabling comments and trackbacks in bulk is easy using Perl and regular expressions:

perl -pi -e 's/<commentsEnabled>true/<commentsEnabled>false/' `find . -name [0-9]*.xml`
perl -pi -e 's/<trackBacksEnabled>true/<trackBacksEnabled>false/' `find . -name [0-9]*.xml`

This is the same approach as I have been used previously to rename categories.

Published by

lekkim

Positive, competent, out-spoken, frank and customer focused architect and developer with a strong foundation in web, cloud and product development. I'm a strong advocate for API first and cloud based solutions and development. I have a knack for being able to communicate and present technically complicated matters in conference, customer and training settings. I've previously acted as team member and leader in a product organisation.