Gathering user feedback is an important aspect for any business. Whether you are making a portfolio site, business site or a blog, user feedback is essential for you to know your customers.
In this tutorial we will learn to
- Create a feedback from
- Set to receive feedbacks in our email and
- Display the feedback form using shortcode
So let’s get started.
First thing you need to do is install contact-form-7 plugin. If you don’t know how to install the plugin visit this wonderful tutorial by WPbeginner folks.
After installing and activating the plugin we will be able to see the Contact menu item in your sidemenu in the wordpress dashboard.
Click on the Contact menu and we can see the list of forms, one new form is already created for us as shown below.
Click on the contact form 1 to edit the form and change the title to Your Feedback
Then in the form tab of the editor paste the following code
Let’s understand the code
Here Your Name (required) is the label that is displayed for the field.
Text is the field type. * means that the field can’t be left empty, without entering the data the form won’t proceed. If you want the field to be empty then you may omit it. and your-name is the field name.
Lets setup the form so that we receive user posted feedbacks in our email. In the same page, goto the mail tab
In the To field edit and put your email address. Everything else you can leave as it is.
Now, whenever a user submits this form, we will be able to receive the users feedback on the email we set in the To field.
After the changes are done, save the form.
To display we use the shortcodes. Shortcode for our recent form is shown just below it’s title
Create a page called feedback and in the content paste the given shortcode
[contact-form-7 id="233" title="Your Feedback"]
The Id might be different but it does not matter.
Understanding the shortcode
Here, contact-form-7 is the shortcode that tells wordpress which shortcode function to load and others are attribute that tells the contact-form-7 plugin how to format the contact form. The id attirbute selects which form to display, each form will have unique id. The title=”Your Feedback” is the title that was given.