Prevent Spam Comments in WordPress

Posted on 25th July, 2013 213 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_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post.php*
RewriteCond %{HTTP_REFERER} !.*domain-name.co.uk.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]
</IfModule>

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.

Comments

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]

Durekbah

08th, Oct, 20

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

Durekbah

10th, Oct, 20

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

Durekbah

11th, Oct, 20

This is nicely said! ! freedom writers movie review essay [url=https://service-essay.com/]paper writing[/url] define dissertation paper

MelviFug

12th, Oct, 20

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

Direkbah

13th, Oct, 20

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

DwayneDethy

13th, Oct, 20

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

MelviFug

14th, Oct, 20

You revealed it effectively.
cialis canada [url=https://canadiantoprxstore.com/]global pharmacy canada[/url] canadian pharmacy cialis

Durekbah

14th, Oct, 20

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

MelviFug

16th, Oct, 20

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

Direkbah

16th, Oct, 20

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

DwayneDethy

17th, Oct, 20

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

Durekbah

17th, Oct, 20

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

Direkbah

19th, Oct, 20

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

DwayneDethy

19th, Oct, 20

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

JamesVen

21st, Oct, 20

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

JamesVen

22nd, Oct, 20

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

RobertBAR

03rd, Nov, 20

erectile dysfunction treatment [url=http://erectiledysfunctionpillscvs.com/#]erectile pills[/url] erectile quality monitor

Durekbah

03rd, Nov, 20

This is nicely expressed! ! persuasive essay college [url=https://homeworkcourseworkhelps.com/]writing paper[/url] meaning of theses

Direkbah

04th, Nov, 20

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

Durekbah

06th, Nov, 20

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

Direkbah

07th, Nov, 20

You said it fantastically! best online essay writers [url=https://topessayssites.com/]cpm homework help[/url] help with assignments

Durekbah

09th, Nov, 20

You explained this very well! narrative essay writing [url=https://freeessayfinder.com/]dissertation online[/url] meaning dissertation

Direkbah

10th, Nov, 20

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

Durekbah

11th, Nov, 20

Superb forum posts. Thanks! essays college [url=https://essayextra.com/]essaytyper[/url] disserted

Direkbah

13th, Nov, 20

Amazing facts. Many thanks! excellent college essays [url=https://quality-essays.com/]courses online[/url] dissertation help uk

BrianTat

16th, Nov, 20

Fine knowledge. Appreciate it.

Provigil A Narcotic [url=https://topmodafinilrxpills.com/]side effects for modafinil[/url]

Durekbah

17th, Nov, 20

You said that terrifically. how to write an essay about your goals [url=https://discountedessays.com/]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

hey

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!

beAppasiomose

12th, Jan, 21

[url=https://cialistodo.com/]tadalafil canada online pharmacy[/url]

beAppasiomose

15th, Jan, 21

[url=https://cialinic.com/]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.

Jaimee

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.

SieSeetteWag

17th, Jan, 21

[url=https://cialsagen.com/]cheap tadalafil 5mg[/url]

beAppasiomose

18th, Jan, 21

[url=https://cial20mg.online/]tadalafil tablet buy online[/url]

vreyrolinomit

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.

beAppasiomose

22nd, Jan, 21

[url=http://oralkamagjelly.com/]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 =)

KbbtBoth

26th, Jan, 21

where can i buy cialis in singapore Levitra Oral Jelly cialis shop in australia [url=https://xz-pharmacyonline.com]cheap prescription drugs online[/url] ’

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]