Simple spam protection for comments
Running a blog or other type of comment form without spam protection is a bit risky theese days. But sometimes you want others to comment on your writings. Fortunately SilverStripe has the SpamProtection module out there which can be easily configured.
I've choosen to use a HoneyPotField, a invisible field which doesn't validate when it's filled out. Fortunately most spam bots are too stupid and fall into that trap. For the others we can enable moderation... And if the honey pot becomes unusable again we have other services like Akismet or Mollom we can easily connect to using SpamProtection module.
So let's install Honeypot field:
composer require studiobonito/silverstripe-spamprotection-honeypot:^1.1.0
which also installs spamprotection as dependency.
Now let's configure it:
#use honeypot as default spam protection FormSpamProtectionExtension: default_spam_protector: '\StudioBonito\SilverStripe\SpamProtection\Honeypot\SpamProtector\HoneypotSpamProtector' #add Comments to all pages and enable moderation Page: extensions: - 'CommentsExtension' comments: require_moderation_nonmembers: true #add spam protection to comments CommentingController: extensions: - 'CommentSpamProtection'
Now your comments should have less spam.
Time to relax! I'll eat some fruit or corned beef...