Your website needs a way for people to get in touch with you (or at least with your representative, if you’re too much a bigshot to answer your own email). It’s best not to have your email address exposed online, however, or it will be “harvested” by spammers and you’ll receive even more tempting offers of Canadian prescription drugs and free money from Nigeria.
To avoid this fate, I put a contact form on each website to let people make initial contact, which the website forwards on to you. The two most popular plugins for this purpose are Contact Form 7 by Takayuki Miyoshi, and WPForms Lite by WPForms. Either is fine, depending on you.
If you are an HTML nerd, use Contact Form 7. Else use WPForms Lite.
Pros & Cons
The big advantage of WPForms for many users is its drag-and-drop WYSIWYG user interface. It’s the quick and easy way to put a form together. Here we’re about to drag the “What is this about” combobox field to a different position.
Contact Form 7, in contrast, is for the more technical user. It uses HTML (like) code to design the form. Here’s an example of how the form looks when you edit it for what fields to include and how they should be arranged.
It looks nothing like it will look on the actual page, but if you feel comfortable with editing this notation, it’s fairly clear how to add or delete your own fields — especially since that row of buttons at the top each pop up a little box to make it simple to create those square-bracketed field descriptions.
Contact Form 7 is a little finicky about your using correct syntax, including closing off every <label> element properly and not including multiple fields in a single label element. There are a few “gotchas” which may puzzle even experienced developers, such as complaining about your having nested label elements when you clearly did no such thing (hint: radio buttons and checkboxes can’t go inside a label element because they have their own implicit labels).
Since I’m comfortable with writing HTML and have gotten used to its grousing, I prefer Contact Form 7 for my projects. These are its advantages:
- You can use HTML and CSS in the form, which gives total control over its appearance — e.g. if you wanted four checkbox fields side by side with borders around them.
- The “quiz” question gives an easy home-baked alternative to reCAPTCHA and similar tools, letting you write your own bot-blocking question that’s easier for humans to answer than squinting at tiny pictures to find the trucks.
- You can design a form which directs to different recipients based on a topic area selection.
But if you’re a beginner or not technically oriented, WPForms is the way to go.
I have written a separate article about spam blocking for comments. However, a contact form is not a comment form — it’s a separate animal that requires different techniques. If you do nothing about spam on your contact form, you’ll get a fair bit of it, mostly from SEO consultants telling you how awful your search scores are and offering to help you (note: they send this to everyone — they haven’t looked at your site), and from people praising your blog and offering to write articles for you (they also haven’t looked at your site but just want to place their advertising/propaganda/whatever anywhere they can).
Most sites, if they do anything to block contact form spam, use reCAPTCHA or a similar alternative. I prefer hCaptcha, a non-spying alternative. The plugin hCaptcha for WordPress by hCaptcha is the official and only recommended implementation of this for WordPress. It works with either of these contact form plugins (as well as many others).
As noted above, if you’re using Contact Form 7 (or the paid version of WPForms), you have the option of adding your own bot-detecting question. This can be either something you think real people can answer easily but that will foil a bot, or something where you give the answer elsewhere on the page that contains the contact form.
I generally prefer the latter because I can embed the answer in a “read this first” section above the contact form, which forces them to actually look at these instructions (e.g. “For rights questions please contact my agent, Myron Biggle of Biggle Literary.”). So I might add a question like this just before the Submit button:
<label> Answer this question to prove you're human (answer is in "Read this first" section above): [quiz quiz-103 "What's my agent's last name (not case sensitive)?|biggle"]</label>
So you’re out of the arms race between spam blockers and spammers, it respects visitor privacy, it’s accessible, and has the added benefit of making sure the sender has at least glanced at any instructional text above the form.
If you find this website helpful, subscribe for email updates!
Your information will not be shared (except with MailChimp, who manages the subscriber list).