There are a range of different WordPress form plugins out there, such as WP Forms, Contact Form 7, and Pirate Forms.
In this example, we'll demonstrate the free-to-use Contact Form 7 plugin.
1. Install the Contact Form 7 Plugin
Log in to your WordPress Admin area and head to Plugins and select Add New. Search for Contact Form 7 and select Install Now , and then Activate.
2. Add a New Contact Form
You’ll now see a new menu option called Contact down the left-hand WordPress sidebar. Select Contact to configure a new form. You’ll see a list of current contact forms, with a default form called 'Contact form 1' having already been added.
We’ll create a new one. Select Add New. You'll see the default form that's been added along with its default data.
3. Configuring Your Form
Form tags are used as placeholders for an HTML form control. For example, you can add a drop-down menu using the drop-down menu tag. You can see our example below and how it affects the form on the site.
- Field type - This sets whether the added field is required to submit the form.
- Name - This is the name of the form tag that is added. It's only used internally so it won't affect how the form field is displayed on the website.
- Options - As this is a drop-down menu tag, there need to be various options for the user to select. In our example, we've used multiple ages.
- Id attribute/Class attribute - If you want to customize your form further, you can assign a CSS ID or Class attribute.
4. Edit the Mail Settings
Now you've configured your form; you'll want to configure where the form sends from and where it sends to. The From address will always need to be an address that uses your domain, e.g., example@yourDomain.com. However, you can set the To address to any email address you want to receive the form.
You'll be able to configure what information from the form gets sent via email; in the example above, you can see the tags: [your-name], [your-email], [your-subject], and [your-message]. This will be the information the form user has entered into the form when they submitted it.
5. Adding the Form To Your Site
Now you've configured the form, you can add it to a Post or Page on your WordPress site. To do this, you'll need the form shortcode provided on the Contact Form page.
In our example, our shortcode is:
Add the shortcode.
Once done, your form will display on the page or post you've added it to.
Comments
0 comments
Please sign in to leave a comment.