Deleting Auto-Deleted Spam comments
The last week, many of us have seen a large increase of spam comments sent to our Community Server blogs. That has given us the opportunity to learn how CS Spam rules work, and to see what a great job they do if configured correctly. And you might also have heard about the Akisment module in the Alabaster package that further adds to the CS Spam rules capability.
So if you're running CS 2.1 on your blog, you can give those spammer a hard time.
Personally I don't understand the purpose of the lastest spam wave. I mean many of the comments don't even have a link in them, just a couple of bad words, or not even that.
What happens when CS Spam rules rates a comment as Spam with enough 'spam points', is that it auto-deletes the comment. With auto-delete it means it is still in the comments list for your blog, but not seen publicly on your blog. But if you look at your comments list for your blog, it is by default filtered to show just published comments. If you instead filter it to just show Spam, those auto-deleted comments will show in your control panel.

That list has on some webs of mine become very large last weeks. And before I knew better
I manually went in and deleted those comments a couple of times a day. Then someone said to me that those are automatically deleted every 30 days by CS, which made me research a bit on how that was done.
What I found is that it is done by one of the CSJobs called DeleteStaleSpamCommentsJob. It runs by default every 15 minutes, and delete spam comments that are older then a expirationDays setting in communityserver.config. If you open communityserver.config and look at the end of the <jobs> section, you'll see:
<job name = "DeleteStaleSpamCommentsJob"
type = "CommunityServer.Blogs.Components.DeleteStaleSpamCommentsJob, CommunityServer.Blogs"
enabled = "true" enableShutDown = "false" expirationDays="30" />
(the line breaks added by me for it to fit within the width of my blog)
If you want to know more about what a CSJob is, read Keyvan Nayyeri's excellent article.
So, I could set this job to not save those unpublished spam comments for 30 days, but for example set it to delete them after 5 days already, or why not 1 day.
Just edit the expirationDays parameter, save the communityserver.config, and touch the web.config. Next time the job runs it will use the new setting.
I did read Keyvan's article before, but somehow missed that setting anyway.
If you enjoyed this post Subscribe to my feed via RSS or e-mail!