I know how to stop spam comments count without using wordpress plugin

how to reduce spam comment count, stop spam comment using htaccess file, reduce spam comments, tips to stop spam commentingWe all love to have lots of comment on our article as it give a feel of satisfaction and pride that people liking our article but it become a source of irritation when you start getting “Spam Comments” more than “Genuine Comments”.

I know you are thinking that I must be a newbie in blogging who doesn’t know about ‘Akismet’, that help you to filter out your spam comments and you can easily delete them all in one go.

But wait….

Why I don’t believe on Akismet

It is correct that ‘Akismet’ filter out comments and put them in spam folder but if you have analyzed them closely you will notice that most of the time it put some “Genuine Comments” into spam folder.

So If you are getting 500 spam comments daily and you are using ‘Akismet’ then you have to go through your each spam comment once before deleting to check whether it’s a “Genuine comment” from your reader or not.

Recently one of my fellow bloggers informed me about it, “He said that whenever I comment on his blog, it went into spam folder”. Same thing I have experienced in my own blog, most of genuine comments goes into spam folder from my fellow bloggers (Note: – Those blogger already have approved comment on my blog so they are not first timer).

In my opinion ‘Akismet’ is just putting spam comment (with some genuine valid comments) into spam folder, it is not stopping spam comments to be enter in your blog.

Why not Captcha

I am not against using ‘captcha’ plugin to reduce spam comment but it has two draw backs.

  1. It’s a plugin with image processing so it increase the load time of your page.
  2. User find filling ‘captcha’ more irritating job (they prefer not to comment most of the time).

My Tricks to stop Spam Comments

I have done some analysis on how spammer put comments on your blog. Most of the spam comment that ‘Akismet’ put into spam folder came from Auto Spam software or scripts.

You can see this easily that same comment from different keyword and different IP address in your spam folder.

A spammer usually access your ‘wp-comments-post.php’ file directly to put comments and it has been observed that most spammer’s doesn’t have any referral value in HTTP_REFERER.

You can easily catch such spammer by putting below code into your ‘.htaccess’ file.

<IfModule mod_rewrite.c>

RewriteEngine On


RewriteCond %{REQUEST_URI} .wp-comments-post.php*

RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR]

RewriteCond %{HTTP_USER_AGENT} ^$

RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]




  1. Before making any change take the backup of your ‘.htaccess’ file.
  2. In above code ‘yourdomain.com’ must be replaced with your own domain name.

Above code just check that whether any request to ‘wp-comments-post.php’ file is having value in ‘HTTP_REFERER’ or not. If it doesn’t have any value then it won’t allow to access file.

I have implemented the above code on my blog around 10 days back (from the date of publishing this article) and it has reduced the spam count around 95% (5% are manual spam).

It is not stopping any of my reader to make comment manually. It is not stopping any other search engine bot to access my pages for crawling (No issue reported in webmaster tool). So the above method is 100% tested and safe to use.

I know that still there are ways that spammer can use to put spam comments, but it is really easy to find one valid comment among 10 spam comment instead of finding one valid comment among 100 spam comment.

If you have any question or issue you can ask that using comment box available below. Your feedback is valuable for us; please share it with us.


  1. Simmeon:

    Hi Sandeep,

    Awesome tip, I did have a captcha on my blog in the beginning but its really not practical. This seems to be a nice alternative. Will implement this soon thanks bro.
    Simmeon recently posted..Content Is King…? I Don’t Think So!My Profile

    • sandeep kumar:

      Thanks Simmeon for your comments…
      You will start seeing its benefit once you implement it…..from the day one you can see the difference.

  2. Mairaj Pirzada:

    Hi Sandeep,

    Great to see you going against Akismet, am completely agree with your points. The Akismet is really a bad plugin, which sometimes seems good but it absolutely marks our genuine comments as spam. Like you same this was happened to me in some previous days. I’ve now disabled Askismet and using Growmap Anti Spambot Plugin, which is really awesome. It is developed by CommentLuv developer..

    It’s performance is really admirable. You must try it, anyway your blog is now going great. But there’s one thing I don’t like,, it’s that you are not using a Premium theme, like thesis, genesis etc. And using this free theme, this might be a reason, your blog is not getting the thing, which really belongs to it..
    Mairaj Pirzada recently posted..Why Blog Commenting? Some Benefits and Tips of Commenting!My Profile

    • sandeep kumar:

      Hi Mairaj…Thanks for your explanatory comment.
      Regarding the theme….its not a free theme…its a paid theme by ‘Theme junkie’….but yes i am not using any framework yet….
      I didn’t find any solid reason for it and more over i don’t have money to buy it (I haven’t monetize my blog yet)……

      but i have noted down your suggestion and I’ll try to implement soon….

  3. Shalu Sharma:

    Interesting way to prevent spam comments. I use the plugin Akismet but its not fool proof, there are some comments that does filter though. I don’t blame you for not liking it, definitely not the best.
    Shalu Sharma recently posted..Lotus Temple – Must see Bahai TempleMy Profile

    • sandeep kumar:

      Hi Shalu…
      Thanks for visiting and sharing your experience with us….
      If you need my help in putting the mentioned code in your blog’s htaccess file then just tell me…..
      I’ll do it for you….

  4. Shalu Sharma:

    Hey Sandeep, thanks for the offer. If I need any help, I will keep you in mind. Very nice of you.. thank you.
    Shalu Sharma recently posted..How to wear sareeMy Profile

    • sandeep kumar:

      Thanks Shalu Ji…
      I am always here (at least after 9 PM IST) to help you all for any blogging, SEO or coding related issue….

  5. Abdu ssamad:

    Really appreciable work.

    I am really frustrated with the Akismet performance.All my comments are going to spam folder.I contacted 3 times the akismet team and got one time replay that hope your problem solved.

    I tried again,but still my comments are going to spam folder… 🙁
    Abdu ssamad recently posted..Guests Posting DON’TS-3 Things Keeping Your Work UnpublishedMy Profile

    • sandeep kumar:

      Thanks Abdu for appreciating my effort….

      Just try my suggestive code….you will see the difference from day one…..

      I think after this article ‘Amismet’ maker will kill me 🙂

  6. Dr Kavita Shaikh:

    Good tip Sandeep. Akismet was never on my good plugin plist anyway. Uninstalled it within a week of starting my blog because I used to get around 100-250 spam comments in a single day despite using Akismet and even the genuine ones got trapped in between spam comments.
    Dr Kavita Shaikh recently posted..5 Mistakes That Could Kill Your Online Small BusinessMy Profile

    • sandeep kumar:

      Thanks kavita for sharing your experience and comments…
      If you need any help in putting the suggested code in your blog then just ping me…..I’ll help you to put it.

  7. Ehsan:

    Thanks for the tips Sandeep bro, As I’m getting tons of spam comments on my blog, I would like to try your method.
    Ehsan recently posted..3 Simple Blogging Lessons We Can Learn From “The Writer”My Profile

    • sandeep kumar:

      Thanks Ehsan for your comments….
      Please share your experience after implementing my suggested code.

  8. Chris:

    Hi Sandeep,
    thanks for this tip. I also don’t use Akismet (did you know that some weeks ago they filtered almost all of my comments on other blogs – I did too much comments in two days (about 100). Fortunately after contacting with their support team they resolved this problem).
    Instead I use commentLuv with GASP.
    But for some of my niche sites I still use AKISMET (yes, I’m accepting comments on some of them 😉 )
    BR and have a nice week!
    Chris recently posted..How to Write an Article in Less Than One Hour – 10 Useful TipsMy Profile

    • sandeep kumar:

      Thanks Chris for your comment and sharing your personnal experience with us.

  9. Bryan:

    Hi Sandep
    Nice post
    great tip , very useful … everyone of us are fed up of spammers , using catpcha was the only alternative, but as you said it has its own demerits .. I will try out your method. thanks for this useful tip
    Bryan recently posted..Following Google Guidelines does not mean you will be on the TopMy Profile

    • sandeep kumar:

      Thanks bryan for your comment…
      I would like to hear your experience after implementing the suggested code.

  10. Chadrack:

    Hmm, this is really great. I’ve never trusted Akismet though I use it. I’ve been using it in conjuction with GASP. But lately, I discovered that, like you said, I’ve been having more manual spam comments even with Akismet and GASP installed! I’ve been thinking of installing another plugin that uses Captcha but frankly, I’m not comfortable with it since I know it will be problem for the genuine readers who wants to comment on the blog.

    I’m going to try out this method and remove both Akismet and GASP. At least that will reduce the number of plugins. Even if the manual spam comments pass through that will be ok since they have been passing through even with Akismet and GASP installed.

    Thanks so much for this.

    P.S. Just saw that you are using GASP! Thought this solution can work without GASP or you just want to be on the safe side?
    Chadrack recently posted..What Do You Think Of A Bloggers’ Hall Of Shame?My Profile

    • sandeep kumar:

      Hi Chadrack…Thanks for your valuable comment bro….
      Regarding your question about GASP….
      I have installed it just couple of hours ago…
      I am just doing some testing about it so that I can recommend it to my readers…..

      but for me ./……the code i have suggested is doing awesome work….

  11. Vineet Saxena:

    Hey Sandeep,
    I never heard about this htaccess script to avoid spam comments. Though I also avoid captcha for the similar reasons you mentioned.
    Vineet Saxena recently posted..The SEO of Canonical URLMy Profile

    • sandeep kumar:

      Thanks Vineet for your comment…..
      and yes if you are getting tons of Spam after using Apismet then give it a try for day one or two ….you will see the difference….

  12. rakesh kumar:

    it seems that a lots of people have a lots of issues with akismet. yes i am one of them,still have akismet on my blog but in deactivated format. i use this wonderful plugin to check website and if required then it is the only plugin that can remove user website links. your tip is nice lets hope this should help us. one more point , if your trick is so fullproof than why are you using gasp pluin here.
    rakesh kumar recently posted..How to create Most Popular Blog Posts in a few StepsMy Profile

    • sandeep kumar:

      Hi Rakesh…..Thanks for your coment bro…..

      My code is working perfectly fine and I have installed GASP just couple of hours ago to do some testing…….so that i can recomend it to my readers.

  13. Kushal Biswas:


    It was added before in one of my blogs.But some of my friends were complaining about this.They cant comment on my blog because of the restriction.

    So I removed it and now I am using a math solving Captcha which is far better than image captha.
    Kushal Biswas recently posted..5 Guidelines on how to Speed up Google ChromeMy Profile

    • sandeep kumar:

      Hi kushal…Thanks for your comment bro…

      I am a bit confuse…. which was causing the problem in commenting (Captcha or code i mentioned here)?

      • Kushal Biswas:

        The htaccess code I am talking about.Are you currently using it in this blog ?
        Kushal Biswas recently posted..5 Guidelines on how to Speed up Google ChromeMy Profile

        • sandeep kumar:

          Hi Kushal… bro i am using this code from last 10 days and I got around 150 comments from almost 70 different peoples….nobody have raised any complaint about it…..

          This code is just checking whether there is a value in referer code of http header or not….. if not then it must a be a bot…..then don’t allow comment…..

          If open a website using browser then…it always have value in referrer of http header and this code will allow you to put comment…..

          either you have put it in wrong place or you haven’t put it properly by mistake……

  14. Gautham Nekkanti:

    Well researched article, Sandeep. Based on my personal experience, Plugins use up resource and ones like Askimet are costly for budding bloggers to afford and not that effective too.
    Gautham Nekkanti recently posted..Best Link Building Methods and Strategies after the Penguin UpdateMy Profile

    • sandeep kumar:

      Thanks Gautham for sharing your views with us.

  15. Aniruddha:

    Neat trick Sandeep! Can’t wait to try this code on my blog. I am sick of even IT companies indulging in spam commenting. I even wrote a post on it!
    Aniruddha recently posted..Cyprus Web Design – diworx.com – Please Stop Spamming My BlogMy Profile

    • sandeep kumar:

      Thanks Aniruddha for sharing your thought with us….and its really sad that spamming have become a business noa a day.

      • Aniruddha:

        yup! A big business. Even SEO companies are becoming lazy and resorting to such tactics
        Aniruddha recently posted..How to Determine Which Backlinks Are Harmful?My Profile

        • sandeep kumar:

          Thanks Anuruddha….I forgot this point….’SEO are Lazy’ and it also lead to more use of ‘paid Click’…….thanks for pointing out.

  16. Donna Merrill:

    Hi Sandeep,

    You have cracked the code! Excellent. I don’t have much trouble with spam on my blog. I am using a WordPress Blog and most of my spam goes into the spam folder. I think it may be because I don’t use things like “Tribe Pro” or other automated systems.

    I do, however check the commentluv lately if there is someone I don’t know well coming on to my blog. I check and see if it is linked to a sales site. If it is, They don’t get to comment!

    Thanks for the Information,
    Donna Merrill recently posted..Law Of Attraction Part 2My Profile

    • sandeep kumar:

      Hi Donna…
      Thanks for appreaciating my effort and sharing your tricks to avoid spam comments.

  17. Theresa Torres:

    Hi Sandeep,
    I’ve read a similar article about Akismet from Ana Hoffman of Traffic Generation Cafe. She also discussed about the problems she encountered with it and their customer service team when she complained about it. She switched to GASP instead.
    Before learning about the limitations of Akismet, I used to think that my comments were not good enough for the blog owners and I felt quite sad. But now that I’m aware, I am more understanding if my comments are not included.
    I’m afraid to touch any codes but it’s good to know that there’s another alternative we can turn to to combat spam comments. Thanks for sharing this information.
    Theresa Torres recently posted..Survey: Consumers still lax on securityMy Profile

  18. Kelvin Wealth:

    Great trick Sandeep…

    I really never thought there was any other way of stopping those automated spam comments apart from plugin….

    I understand your code very well and It’s a great trick… I think I will implement it very soon….

    Kelvin Wealth recently posted..Why Is Blogging So Frustrating?My Profile

    • sandeep kumar:

      Thanks Kelvin for commenting and appreciating my effort.

  19. Kuladip Roy:

    Great post Sandeep, captcha plug ins is truly not reliable at this present scenario, so your point is truly awesome. Thanks again.

  20. Ahsan:

    Akismet is a good plugin to check spam comments. But I agree with your points. Sometimes genuine comment goes to spam comment. By checking manually in every 50 spam comments I get a genuine comment. So it wastes lots of time. I’ll try your process.
    Ahsan recently posted..How To Make Strong Password To Secure Your Net StuffMy Profile

    • sandeep kumar:

      Hi Ahsan…thanks for your comment bro…
      You will see the difference once you implement my suggestion.

  21. Ajay Garg:

    I just updated the code at bottom of my .htaccess file . I will share you whats happening with my site.

    Thanks Sandeep
    Ajay Garg recently posted..Intimate Scene of Sunny LeoneMy Profile

    • sandeep kumar:

      I am very much willing to see your experience with this tips

      • Ajay Garg:

        Hi Sandeep,
        I dont know whats happening. But its very bad experience with me. I updated your code on .htaccess file but after that I got 28 spam comments.

        Ajay Garg recently posted..Intimate Scene of Sunny LeoneMy Profile

        • sandeep kumar:

          Hi Ajay can you share your code that you put in your htaccess file and sample of comments (if they are manual comments then yes you can’t stop them anyway).

  22. Ajay Garg:

    I put this code at last of my .htaccess file.

    RewriteEngine On

    RewriteCond %{REQUEST_METHOD} POST

    RewriteCond %{REQUEST_URI} .wp-comments-post.php*

    RewriteCond %{HTTP_REFERER} !.*bollywoodera.com.* [OR]

    RewriteCond %{HTTP_USER_AGENT} ^$

    RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

    and comments are like :-

    Your zone to play free Agame – A game online! Play free games online together with racing games, sports games and a lot of at agamegame.org…

    comprehensive search marketing specialist l comprehensive search marketing strategies l search marketing specialist l comprehensive search marketing l internet marketing specialist l Scottsdale SEO Company l Web marketing specialist l Online marketin…
    Ajay Garg recently posted..Intimate Scene of Sunny LeoneMy Profile

    • sandeep kumar:

      I hope you have your .htaccessfile in your root folder (your domain folder)

      here is what my code look like

      RewriteEngine On
      RewriteCond %{REQUEST_METHOD} POST
      RewriteCond %{REQUEST_URI} .wp-comments-post.php*
      RewriteCond %{HTTP_REFERER} !.*seobloggerstips.com.* [OR]
      RewriteCond %{HTTP_USER_AGENT} ^$
      RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

      I have added this code in the starting
      It has stopped spam comments (auto spam comments) but if a user do manula spam comments then there is no way to stop it.

      join me on facebook (go to my profile through my fanpage and we will discuss your issue on chat (i’ll be available in the night after 9 PM)

  23. Hi,
    awesome tips to stop spamming, I like this blog I have get a lot of useful information and fresh knowledge from your blog or site.


  24. Govand Malhani:

    Awesome tip ;;; I understand your code very well and It’s a great trick… I think I will implement it very soon….

    • sandeep:

      Thanks for your comment Govand

  25. Lokesh Muniyal:

    This code is way better to use instead of Captcha Plugin. Additionally it will eliminate the load of a plugin on the server. I will surely use this exquisite trick. Great work Sandeep
    Lokesh Muniyal recently posted..Samsung Omnia W Vs Nokia Lumia 710My Profile

  26. Felicia:

    Hi Sandeep,
    Your way on how to stop spam comments without using any plugin is really unique! I am no coder, so this is very new to me and I am quite hesitant in trying your method because I might screw it up on my blog. I rely on Akismet and GASP to help me ward off spammers on my blog, but I do agree that Akismet is not a perfect anti-spam plugin.
    Felicia recently posted..Two Men Accused Of Robbing Women Of Her Video Poker CashMy Profile

  27. Mukesh Mali:

    It’s great to hear about Akismet, I wanna try this, because I receive lots of spam comments. sandeep kumar can you explain me how it works?
    Mukesh Mali recently posted..10 Most Popular Online Coupon & Promotional Code SitesMy Profile

  28. Avnish Gautam:

    Stoping spam comments without using any plugin is really a new information for me. I will try to apply this on my blog. Thanks.
    Avnish Gautam recently posted..Stop Spam Comments on WordPress with Akismet PluginMy Profile