3 ways to avoid spam comments on WordPress

Since I’ve started posting articles on this blog, I was assaulted by comment spammers or spam trackbacks.I am tired of this and I’ve decided to search a few methods to avoid spam commenting that will help me to easely sort spam comments by the others and I’ve found a few ways to reduce spam comments that might be also useful for you :

  • Firstly you can start by installing Askimet Plugin, that is considered the best wordpress plugin for reducing comment spamming on wordpress blogs.This plugin checks each comment,pingback or trackback that is sent to your blog and sort them automatically.This is the firts plugin that I’m installing on my new blogs.Using Askimet , you can see a stats page, where you can check the amount of spam comments sent everyday.
  • A second step to avoid spam comments is closing comments on older posts.You can do this by accesing you dashboard and then going to Settings.There you need to click on “Discussion” and you check the box for “Automatically close comments on articles older than…”.You can close comments for articles older than 90 days, because some readers may read your blog after a few days  and you need to allow them to comments on your blog, so 90 days is a good period of time for all you readers to comment on your blog.
  • And the last method that I’ve used is a custom wordpress function to ban empty referrers.Spammers are not visiting your website to post comments, so you can use this principle to reduce the number of spam comments.To do this, you need to visit your dashboard and then you go to “Theme editor”.There you select the theme that you’re using on your blog and go to “functions.php”.Once you’re there, you need to copy this code  there :
<?php
function verify_comment_referer() {
    if (!wp_get_referer()) {
        wp_die( __('You cannot post comment at this time, may be you need to enable referrers in your browser.') );
    }
}
add_action('check_comment_flood', 'verify_comment_referer');
?>

This is not an article for advanced bloggers , but I tought that will be useful for newbies or any other blogger that is trying to drastically reduce the number of spam comments on his blog.

If you like my articles, please follow me on @niceblogger .

 

Next Entries »