ShoutMeLoud – Shouters Who Inspire

≡ Menu
≡ Menu

How to avoid Spam comments on WordPress using .htaccess method

How to avoid Spam comments on WordPress using .htaccess method

These days I’m seeing lots of wordpress spam comments.The simplest way to avoid spammer is by using Akismet wordpress plugin

You can get the Akismet WordPress plugin from here.

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.

If you don’t know how to edit your .htaccess file, read my previous post on

how to edit wordpress .htaccess   file

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

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

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

deny from

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.

If you are not familiar with wordpress, do read my previous tutorial on

Step by step guide to Install self hosted #Wordpress blog

  • Author Bio

  • Latest Post

Article by Harsh Agrawal

Harsh has written 1096 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.


Leave a Comment