Prevent Spam Comments in WordPress

Posted on 25th July, 2013 499 Comments

This is a very popular subject indeed and to be honest I’m not surprised. For the most this is one of those things that you just have to put up with if you have an online presence. But thankfully there are a few things that you can do to make it near impossible for these spam whores from raping your comments.

So the first thing we can do is open up the .htaccess file in your main WordPress server folder, using an ftp client or your cpanel. Open it up in notepad or any text editor (NOT MS WORD!).


Block the Robots…

Add the following few lines at the bottom of our file.

### Deny Spambots ###
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} .wp-comments-post.php*
RewriteCond %{HTTP_REFERER} !.** [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]

All this does is check to see if the comment comes from a human or a spam bot (if the comment has a referrer). If it’s from a spam bot then the comment gets blocked automatically.


Block the humans

This ones even simpler to solve than the robots; You have a few options here, using particular plugins and online services like akimet, but personally I prefer the free option. I’ve been using this plugin for about 3 years now and can count the amount of spam I’ve had come through on one hand.

Invisible capture

Believe me when i say that this is all you’re going to need.

Honestly this should come built in as a part of WordPress, there is no capture code to fill in, it does all the work in the background like a sneaky spam ninja.

LionScripts: IP Blocker Lite

ip blocker

This little baby will allow you to block persistent spammers by allowing you to add and block their IP address. But from personal experience spammers will change their own IP or use a dynamic IP witch will bypass this blocker, so this one is up to you.


To preserve code added to a comment you can wrap your code in short tags
by using [square brackets]:

  1. PHP use - [php] <?php code here ?> [/php]
  2. CSS use - [css] #code-here {} [/css]
  3. HTML use - [html] <div> code here </div> [/html]
  4. JS use - [js] $(".codeHere") [/js]


08th, Oct, 20

You stated it adequately. best essay writing service canada [url=]good thesis statement[/url] psychology dissertation topics


10th, Oct, 20

Amazing information, Cheers! websites that write essays for you [url=]xyz homework[/url] write dissertation proposal


11th, Oct, 20

This is nicely said! ! freedom writers movie review essay [url=]paper writing[/url] define dissertation paper


12th, Oct, 20

Nicely put. With thanks!
canadian viagra [url=]drugs for sale[/url] canadian pharmacies without an rx


13th, Oct, 20

You actually expressed this very well. write my essays [url=]online dissertation[/url] dissertation structure


13th, Oct, 20

Seriously loads of very good facts! northwest pharmacy/com [url=]canada drugs[/url] prescription online


14th, Oct, 20

You revealed it effectively.
cialis canada [url=]global pharmacy canada[/url] canadian pharmacy cialis


14th, Oct, 20

Fine forum posts. Kudos! custom essays essay help [url=]paper helper[/url] edit dissertation


16th, Oct, 20

Cheers. An abundance of stuff.
approved canadian pharmacies online [url=]canadian pharmacies that ship to us[/url] global pharmacy canada


16th, Oct, 20

Kudos. Quite a lot of info.
how to write essays fast [url=]help writing thesis[/url] dissertations & theses


17th, Oct, 20

Seriously lots of excellent material. best online canadian pharcharmy [url=]ed drugs[/url] drugstore online


17th, Oct, 20

Fantastic info, Regards. how to write a lit essay [url=]help writing thesis[/url] define dissertations


19th, Oct, 20

Nicely put, Regards. we write essays [url=]writers help[/url] dissertation marks


19th, Oct, 20

Nicely put, Kudos! walmart pharmacy price check [url=]list of legitimate canadian pharmacies[/url] canada medication pharmacy


21st, Oct, 20

systems dialect mayhap be suffering with limiting entirely disorder own. [url=]cialis generic[/url] Edhlxg ynrsac


22nd, Oct, 20

cialis corrupt online confirmed, so it is also to respond. [url=]cialis generic[/url] pink you again and again and hoodwink a known cad.


03rd, Nov, 20

erectile dysfunction treatment [url=]erectile pills[/url] erectile quality monitor


03rd, Nov, 20

This is nicely expressed! ! persuasive essay college [url=]writing paper[/url] meaning of theses


04th, Nov, 20

With thanks. Good stuff. cheapest essay writing service [url=]help dissertation[/url] dissertation only phd


06th, Nov, 20

Superb material. With thanks. how to write personal essays [url=]research dissertation[/url] etd dissertation


07th, Nov, 20

You said it fantastically! best online essay writers [url=]cpm homework help[/url] help with assignments


09th, Nov, 20

You explained this very well! narrative essay writing [url=]dissertation online[/url] meaning dissertation


10th, Nov, 20

Thanks, Loads of information.
need help writing scholarship essay [url=]online coursework[/url] custom dissertation writing services


11th, Nov, 20

Superb forum posts. Thanks! essays college [url=]essaytyper[/url] disserted


13th, Nov, 20

Amazing facts. Many thanks! excellent college essays [url=]courses online[/url] dissertation help uk


16th, Nov, 20

Fine knowledge. Appreciate it.

Provigil A Narcotic [url=]side effects for modafinil[/url]


17th, Nov, 20

You said that terrifically. how to write an essay about your goals [url=]help in thesis writing[/url] postgraduate thesis

ed meds

28th, Nov, 20

can erectile dysfunction be fixed
how erectile dysfunction drugs work
erectile therapy after prostatectomy

Pat Mazza

24th, Dec, 20

Major thankies for the blog article.Really looking forward to read more. Really Great.

cialis coupon

26th, Dec, 20

does radiation therapy for prostate cancer result in impotence? when taking blood pressure what dos it mean if your pressure is all over the place. cialis online Uixuq84 jdersi cialis aleve interaction


05th, Jan, 21

Taxi moto line
128 Rue la Boétie
75008 Paris
+33 6 51 612 712  

Taxi moto paris

Excellent post. I used to be checking constantly this weblog
and I’m inspired! Extremely useful info specifically the final
section 🙂 I care for such information much. I was looking for this certain information for a very lengthy time.
Thanks and good luck.

Shanika Woolcott

06th, Jan, 21

I used to have a pop-up message when i start firefox to restore last session but now it’s gone. I need it in case i accidentally close something and i want to go back into it. Anybody know how to do it? Thanks..

Valentina Tippins

08th, Jan, 21

Fantastic post but I was wondering if you could write a litte more on this topic? I’d be very grateful if you could elaborate a little bit more. Thank you!

vreyro linomit

10th, Jan, 21

We absolutely love your blog and find almost all of your post’s to be just what I’m looking for. can you offer guest writers to write content available for you? I wouldn’t mind producing a post or elaborating on a few of the subjects you write about here. Again, awesome website!


12th, Jan, 21

[url=]tadalafil canada online pharmacy[/url]


15th, Jan, 21

[url=]tadalafil 40 mg daily[/url]

saç uzat

16th, Jan, 21

Hello every one, here every person is sharing such
familiarity, so it’s fastidious to read this
webpage, and I used to pay a quick visit this web site all the time.


17th, Jan, 21

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let s have a personal and meaningful conversation.


17th, Jan, 21

[url=]cheap tadalafil 5mg[/url]


18th, Jan, 21

[url=]tadalafil tablet buy online[/url]


20th, Jan, 21

I am just commenting to let you understand of the beneficial encounter my cousin’s daughter had going through your blog. She mastered a lot of pieces, which included what it is like to have an ideal giving character to have most people without difficulty completely grasp a number of complex subject areas. You really surpassed my expected results. Thanks for churning out those important, trusted, explanatory and also fun tips about that topic to Evelyn.


22nd, Jan, 21

[url=]kamagra walgreens cost[/url]


22nd, Jan, 21

Great article! That is the type of information that should be
shared around the net. Disgrace on the search engines for
now not positioning this put up upper! Come on over and discuss with
my site . Thanks =)


26th, Jan, 21

where can i buy cialis in singapore Levitra Oral Jelly cialis shop in australia [url=]cheap prescription drugs online[/url] ’


30th, Jan, 21

canadian cialis reviews cialis sell cialis [url=]cialis from canadian pharmacy registerd[/url] ’


31st, Jan, 21

typical cialis prescription strength Coreg cialis oline [url=]brand viagra[/url] ’

cheap flights

31st, Jan, 21

Excellent way of telling, and fastidious article to get information regarding
my presentation focus, which i am going to
present in institution of higher education.

vreyro linomit

31st, Jan, 21

Thank you for another wonderful article. Where else could anybody get that type of info in such a perfect means of writing? I have a presentation next week, and I’m on the look for such info.

cheap flights

01st, Feb, 21

I’m not sure exactly why but this web site is loading incredibly slow
for me. Is anyone else having this problem or is it a issue on my end?
I’ll check back later and see if the problem still exists.

cheap flights

01st, Feb, 21

Wow, this post is good, my younger sister is analyzing such things, therefore
I am going to tell her.


04th, Feb, 21

[url= ]cialis 20 mg price comparison[/url]

situs judi online

06th, Feb, 21

Hi there, I discovered your site via Google even as lookin foor a
comparable subject, your webste got here up, it appears to be like good.
I’ve bookmarked it in my google bookmarks.
Hi there, just become aware of your weblog thru Google, and found that it is really informative.
I’m going to watch outt for brussels. I’ll be grafeful in the event
you proceed this in future. Numerous other folks will probably
be benefited from your writing. Cheers!

Here is mmy homepage :: situs judi online

Novo 2

10th, Feb, 21

I am curious to find out what blog platform you have been utilizing?

I’m experiencing some small security issues with my latest website and
I would like to find something more safeguarded. Do you have any


11th, Feb, 21

I do consider all the concepts you’ve introduced
on your post. They are very convincing and will certainly work.
Still, the posts are too brief for novices. May just you please extend them a little
from subsequent time? Thanks for the post.


13th, Feb, 21

what is the best for arthritis pain – buy cialis Acokk13
cialis 80 mg dosage
viagra precisa de receita especial: [url=]cialis generic[/url]


14th, Feb, 21

[url= ]tadalafil from canada[/url]

Warning - scam website will steal your money

15th, Feb, 21

First of all I would like to say terrific blog! I had a quick question in which I’d
like to ask if you don’t mind. I was curious to find out how you
center yourself and clear your mind prior to writing.
I’ve had a difficult time clearing my thoughts in getting my ideas out there.
I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are
usually lost simply just trying to figure out how to begin. Any ideas or tips?
Thank you!


20th, Feb, 21

bolo shoes dallas payless shoes home [url=]parade of shoes in nyc [/url]
boston red sox shirts elvis tee shirts <a href=””> save the tatas shirt </a>
footprints women’s shoes birkenstock t shirt custom printing 5xl bass shoes mens sandals

agen judi online

03rd, Mar, 21

I know this website provides quality depending content
and other material, is there any other website which presents these kinds of data in quality?

agen judi bola

03rd, Mar, 21

These are truly fantastic ideas in on the topic of blogging.
You have touched some pleasant things here. Any way keep up wrinting.

Wilford McGuffog

03rd, Mar, 21

If you are going for finest contents like myself, only visit
this web page daily as it gives quality contents, thanks

สุชัญญา มีทอง

03rd, Mar, 21

Hey I am so excited I found your webpage, I really
found you by mistake, while I was researching on Bing for something else, Anyways I am here now and would just like to say cheers for a tremendous post and a all round thrilling blog (I also love the theme/design), I don’t have time
to browse it all at the moment but I have saved it and also included your RSS feeds, so when I have time I will be back to
read a lot more, Please do keep up the superb job.

generic name of ampicillin

14th, Mar, 21

Unquestionably believe that which you said. Your favorite reason appeared to
be on the web the easiest thing to be aware of. I say to you, I certainly get
annoyed while people think about worries that they just don’t know about.
You managed to hit the nail upon the top and defined out
the whole thing without having side-effects , people could take a
signal. Will likely be back to get more. Thanks


21st, Mar, 21

I loved as much as you will receive carried out right here.
The sketch is tasteful, your authored material stylish. nonetheless, you
command get got an impatience over that you wish be delivering the following.
unwell unquestionably come further formerly again since
exactly the same nearly very often inside case you shield this hike.


25th, Mar, 21

I just like the helpful info you supply on your articles.
I’ll bookmark your weblog and check again here regularly.
I’m fairly certain I’ll be told lots of new stuff right
here! Good luck for the following!

st paul vet clinic

26th, Mar, 21

Hi there, just became aware of your blog through Google, and
found that it is truly informative. I am going to watch out for brussels.

I’ll be grateful if you continue this in future. Lots of people will be benefited from your
writing. Cheers!


05th, Apr, 21

At this time I am going away to do my breakfast, after having my breakfast coming again to read further news.


06th, Apr, 21

Hello there, I discovered your web site by way of Google while looking for a similar topic, your website got here up, it appears good.

I’ve bookmarked it in my google bookmarks.
Hello there, simply changed into aware of your weblog thru Google,
and located that it is really informative. I’m going to be careful for brussels.
I’ll be grateful if you happen to proceed this in future.
Lots of other folks will likely be benefited out of your writing.


08th, Apr, 21

Hi there friends, its impressive piece of writing on the topic of educationand completely defined, keep it up all the time.

asmr 0mniartist

Donnell Rines

17th, Apr, 21

Hey! Would you mind if I share your blog with my zynga group? There’s a lot of people that I think would really enjoy your content. Please let me know. Many thanks

Yuki Mccuaig

26th, Apr, 21

Have you ever heard of second life (sl for short). It is basically a video game where you can do anything you want. sl is literally my second life (pun intended lol). If you want to see more you can see these second life websites and blogs

13th, May, 21

Hello! I realize this is somewhat off-topic however I
needed to ask. Does running a well-established website such as yours take a
massive amount work? I am completely new to operating
a blog however I do write in my journal on a daily basis.
I’d like to start a blog so I can easily share my own experience
and thoughts online. Please let me know if you have
any ideas or tips for brand new aspiring blog owners.

or asmr

21st, May, 21

I’ve been surfing on-line more than 3 hours these days, yet I by no means
discovered any attention-grabbing article like yours. It is pretty value sufficient for me.

In my view, if all web owners and bloggers made excellent content material as you probably
did, the internet might be a lot more helpful than ever before.

judi blackjack

14th, Jun, 21

Thanks a bunch for sharing this with all people you really
understand what you are talking about! Bookmarked. Please additionally visit my website =).
We will have a hyperlink trade arrangement between us


15th, Jun, 21

It is in reality a nice and helpful piece of info. I’m glad
that you shared this helpful info with us. Please keep us up to date like this.
Thanks for sharing.


19th, Jun, 21

Hello, I do think your website could be having browser compatibility problems.
Whenever I look at your blog in Safari, it looks fine however, when opening in Internet Explorer, it’s got some overlapping issues.

I merely wanted to provide you with a quick heads up! Other than that,
wonderful website!


20th, Jun, 21

Magnificent beat ! I would like to apprentice while you amend
your web site, how could i subscribe for a blog site?
The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast offered bright clear idea


06th, Jul, 21


Below you will discover the link to some internet sites that we assume it is best to visit.


10th, Jul, 21

Nolvadex [url= ]good rx pharmacy[/url] canadian drug pharmacy review


14th, Jul, 21

Hi I am so thrilled I found your web site, I really
found you by accident, while I was browsing on Askjeeve for something
else, Nonetheless I am here now and would just like to say cheers for a tremendous post
and a all round entertaining blog (I also love the theme/design), I don’t have time to
browse it all at the minute but I have book-marked it and also included your RSS feeds,
so when I have time I will be back to read more, Please do keep up the
superb b.

moving company los angeles

08th, Aug, 21

I was excited to find this site. I need to to thank you for
your time due to this fantastic read!! I definitely loved every little
bit of it and i also have you saved to fav to check out new things in your


09th, Aug, 21

Just desire to say your article is as astonishing. The
clarity in your post is just cool and i can assume you are an expert on this subject.

Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post.
Thanks a million and please carry on the enjoyable work.

29th, Aug, 21

รู้เรื่องขอรับว่ากระแสพนันออนไลน์ก็แรงอยู่ แม้ว่าเอาจริงๆถ้าว่าพวกเราเล่นแบบมีสติสัมปชัญญะ เดี๋ยวนี้นับว่าเป็นช่องทางที่ทำเงินเจริญก้าวหน้าทีเดียวครับ เดี๋ยวนี้ผมก็ได้ผลกำไรมา 4 หลัก ยังตื่นเต้นไม่หายเลยจ๊ะขอรับ เพราะเหตุว่าเคยรู้สึกว่ามันน่าขนลุกเช่นไร เว็บจ่ายจริงผมแนะนำUFABET ขอรับ

zovre lioptor

05th, Sep, 21

Thank you for another informative blog. Where else could I get that type of info written in such an ideal way? I’ve a project that I am just now working on, and I’ve been on the look out for such information.

Leave a Comment

To preserve code added to a comment you can wrap your code in short tags
by using [square brackets]:

  1. PHP use - [php] <?php code here ?> [/php]
  2. CSS use - [css] #code-here {} [/css]
  3. HTML use - [html] <div> code here </div> [/html]
  4. JS use - [js] $(".codeHere") [/js]