Adding a contact form to your site is a good way for people to get in touch with you. You can set it up in ‘Contact’ which is in the backend, on the left hand side menu.
- Click on the ‘Add new‘ form
- Name the form; I called this one ‘Contact Us’
- Make sure the form is setup correctly – it should look something like the image below:
- Click on ‘Mail along the top menu header of Contact forms (see image below)
- Set the ‘To‘ email to the email you’d like to receive the message (your email)
- Change the ‘From‘ email to: [Project Norfolk Site] <email@example.com>
- The subject line can be something like ‘site contact form’ – this is how it will appear in your inbox if someone uses it.
- Save the changes.
- Copy (ctrl+c) the shortcode of the contact form – which you can see highlighted in blue at the top of the form.
- Go to ‘Appearance’ then ‘Widgets’ (on the left hand side menu)
- Drag a ‘Text’ widget to one of the areas ‘Village sign’ or ‘Primary Widget Area’ or Secondary Widget Area’
- Paste the shortcode you copied from the Contact form into the text area in the widget.
- Give the widget a title (I used “Get in touch”)
- I also added the paragraph code <p> </p> which gives a space between the title and the form.
- Save the widget and go and view it on the front of the site.
- Test it works, send yourself a test message
Add reCAPTCHA to prevent spam bots
Register with Google to set up a reCAPTCHA API key, this will allow your form to include a little checkbox which prevents bots from spamming your contact form.
Once you’ve registered to get your reCAPTCHA API Keys you will need to add your parish site to the domains list on the reCAPTCHA site, under ‘Adding reCAPTCHA to your site’ – you should also see an option called ‘Keys’ which will give you a site key and secret key – 2 sets of characters to use on your parish site.
Then when you’ve added the two keys to your parish site, you will need to go back to Contact forms, and select the ‘reCAPTCHA’ button on the ‘form’ menu section, make sure you place it at the end of the form. Save the updated form, then go and test it on the front end of the site – you shouldn’t be able to send a message without the checkbox checked.