ShoutMeLoud – Shouters Who Inspire

Superlinks
≡ Menu
≡ Menu

How To Avoid Spam Comments on WordPress Using .htaccess method

CW
How To Avoid Spam Comments on WordPress Using .htaccess method

One of the biggest challenge which you will face while running a blog is combating spam in various form. One of the most common form of spam is comment spam and when it comes to WordPress we have various ways to battle comment spam. One of the best way is by using Akismet WordPress plugin and you can watch below embedded  video (Direct link ) to learn how to use the plugin.

You can get the Akismet WordPress plugin from here and check this guide to learn how to get free API key for Akismet plugin.

Though at times if you will see your comment spam page, you might find few IP’s are constantly sending comment spam. The easiest way to get rid of these spam is by blocking their IP address using .htaccess method. I highly recommend keeping a backup of your .htaccess file before editing it. .Htaccess file is located at the root of your WordPress installation and you can either use SEO by yoast plugin > Edit files to edit your .htaccess file or you can follow this guide which I have mentioned below to make changes in your .htaccess file. Make sure you take a backup of your .htaccess file before making changes, as even a single wrong character will  make your site inaccessible.

Here is the code that you need to enter in your .htaccess file, and upload it.

<Limit GET POST>
order allow,deny
deny from 88.146.119.120
allow from all
</Limit>

You can always enter more IP’s by adding one more line

deny from xx.xxx.xxx.xxx

You can get the IP of the spammer in your spam comment page, under WordPress dashboard I find this way to be the best way to fight against the lots of spam from bots. Here is one post which I recommend to every WordPress blogger to read regarding comment moderation on their blog:

  • Author Bio

  • Latest Post

Article by Harsh Agrawal

Harsh has written 1069 articles.

If you like This post, you can follow ShoutMeLoud on Twitter. Subscribe to ShoutMeLoud feed via RSS or EMAIL to receive instant updates.


{ 1 comment… add one }

  • Nihar

    I did this before. When some bad guy kept spamming and also used abusive language.

    Reply

Leave a Comment