Forum

Thread tagged as: Question, Problem, Forms

Spam in comments form

I am getting a lot of spam coming through the comments form on the site I am managing for my client.

Is there a way to implement a captcha for the comments form to stop the barrage of spam?

Scott

Scott Herman

Scott Herman 0 points

  • 2 years ago
Simon Clay

Simon Clay 127 points

Hi Scott,

There isn't an out-of-the-box way.

There are however two other options: honeypot and Akismet: as described here: https://docs.grabaperch.com/addons/blog/spam/

I use honeypot for my sites and I find it quite effective. I prefer these to captcha, which puts the hassle onto the end user to prove they are not a robot.

Akismet works very well in my experience.

Just enable akismet and you'll get like 1 false positive a month...

Simon Clay said:

There are however two other options: honeypot and Akismet: as described here: https://docs.grabaperch.com/addons/blog/spam/

I use honeypot for my sites and I find it quite effective. I prefer these to captcha, which puts the hassle onto the end user to prove they are not a robot.

Hi Simon, I have been attempting to implement the Honeypot method but it's not working for me. The honeypot field works when I turn off my css that hides it but the bots appear to only fill out half the fields so I'm assuming they are leaving that one too. Do you have an example or could you link me to a form that's working so I could check out to see if I can get it working?

Jana, I've found that the bots only fill in the field if it's named something that they think should be filled out. I usually have a real name field and a fake one, and I've found that the bots usually fill in both:

<perch:form id="contact" class="contactForm" method="post" app="perch_forms">

    <perch:label for="contact_name">Name</perch:label>
    <perch:input type="text" required="true" id="contact_name" label="Name" />

    <perch:label for="contact_email">Email Address</perch:label>
    <perch:input type="email" required="true" id="contact_email" label="Email" />

    <perch:label for="message">Message</perch:label>
    <perch:input type="textarea" id="message" label="Message" rows="12" required="true" encode="false" />

    <perch:input type="text" id="name" antispam="honeypot">

    <perch:input class="rectLink" type="submit" id="submit" value="Submit" />

</perch:form>

Thanks Shane, it's working a treat now!

You don't need a form to submit a comment to the wp-comments-post.php file, or to send a pingback or trackback. Spammers don't use forms, they simply send their spam directly.

Removing the form doesn't "turn off" comments. To do that, go to the Posts screen, and use the Quick Edit to actually disable comments and trackbacks for the various posts. Also visit the Settings->Discussion page, and set it to disable comments and trackbacks for new posts as well.

Once you do this, then the comments being sent directly will be rejected by WordPress. That will actually turn them off.

https://mobdro.ooo/