For simple contact forms, I’ve been using the contact form in Jetpack rather than Contact Form 7, which is my go-to contact form plugin. One thing I missed was having a subject field in the form. I wanted a visitor to be able to type the subject of their message, and have that be the subject line of the resulting email. Here’s how to do that:
- Edit your Jetpack contact form.
- Add a new field with Label “Subject” and Field type of Text.
- Choose whether the field is required or not.
- Save the field and insert the form.
- Within the contact-form shortcode, find the field you created. Change the
It should look like
[contact-field label='Subject' type='subject' /].
It seems the field must have placeholder/default text. By default, Jetpack will use the name of your page. You can manually set the placeholder/default text by adding
default='Subject' to the subject field in the contact form shortcode, where “Subject” is the placeholder/default text. I use an empty string so that the subject field starts blank and the user must fill it:
[contact-field label='Subject' type='subject' default=''/]
Here’s my complete contact form shortcode:
[[contact-form subject='Subject'][contact-field label='Name' type='name' required='1'/][contact-field label='Email' type='email' required='1'/][contact-field label='Website' type='url'/][contact-field label='Subject' type='subject' default='' required='1'/][contact-field label='Message' type='textarea' required='1'/][/contact-form]]
Does Your WordPress Site Need Maintenance?
It’s good that you want your web forms to work well. But are you staying on top of WordPress updates, backups, and security? We can help your website run smoothly—and safely. Sign up for your WordPress Maintenance Plan today.