Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 799 forks source link

Contact Form Fields should accept the desired values #16815

Closed MuhammedSwalihct closed 4 years ago

MuhammedSwalihct commented 4 years ago

As of now, the contact form fields such as the "Date" selection field accepts any values making it easier for spam bots to fill out the forms with random letters and the form is being submitted without any warnings. So, if we make the fields accept only certain values (for example, the date field will only accept date values selected using the calendar), we can prevent this and at least get rid of the less-intelligent spambots.

In addition to this, introducing a simple form field like a math question or a field that can only accept a certain answer would also be a great alternative for beginner webmasters instead of opting for the reCaptcha and stuff. So, such features would definitely make the contact forms much better in terms of spam prevention. I am not saying that we can filter out 100% spam with this method, but at least the mailboxes or feedback sections won't fill out with 1000s of spam submissions.

jeherve commented 4 years ago

Most of the contact form fields have types that match the value they expect, but the date field does not, indeed. It's a change we made a few years ago, in #7890. It may be worth revisiting this now that browsers may have better support for the date field than back then.

I'll update #7888 to mention the idea of bringing the date type back, as per your suggestion, thank you!

In addition to this, introducing a simple form field like a math question or a field that can only accept a certain answer would also be a great alternative for beginner webmasters instead of opting for the reCaptcha and stuff.

This is something we most likely will not implement in the Jetpack contact form, as such fields tend to be defeated quite easily by bots once they've discovered it. With a popular plugin such as Jetpack, that's something that tends to happen quite quickly. To protect yourself against spam in contact forms, we recommend using Jetpack's Anti-spam solution; it also covers contact forms.