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]