How to Use Contact Form 7 in WordPress

Contact Form 7 is one of the most popular plugins for adding contact forms to your WordPress website. Whether you’re a business owner looking to engage with customers or a blogger wanting to receive messages from your readers, Contact Form 7 offers a simple and efficient way to collect form submissions.


Why Use Contact Form 7?

Contact Form 7 is a versatile and easy-to-use plugin for WordPress. Here’s why you might choose it for your website:

  • User-Friendly Interface: No coding skills are required to create and manage forms.
  • Highly Customizable: You can create simple contact forms or more complex forms with multiple fields, validation, and custom styling.
  • Free: Contact Form 7 is completely free to use, making it an excellent option for website owners on a budget.
  • Spam Protection: Built-in CAPTCHA support helps protect your forms from spam.
  • Multi-Language Support: It supports multiple languages, making it accessible for international websites.

Step 1: Install Contact Form 7

Step 1.1: Install the Plugin

  1. Go to Your WordPress Dashboard:
    • Navigate to Plugins > Add New.
  2. Search for Contact Form 7:
    • Type “Contact Form 7” in the search bar.
    • Click Install Now for the plugin by Takayuki Miyoshi.
  3. Activate the Plugin:
    • After installation, click Activate.

Step 2: Create a Contact Form

Step 2.1: Access the Form Settings

  1. Navigate to Contact Form 7:
    • Go to Contact > Contact Forms in your WordPress dashboard.
    • You’ll see a default form titled “Contact Form 1.”
  2. Edit the Default Form:
    • Click Edit to modify the form, or Add New to create a new one.

Step 2.2: Customize the Form Fields

The default form includes fields for Name, Email, and Message. You can add or remove fields as needed. Here’s an example layout:

[text* your-name id:your-name]
<label for="your-email">Your Email</label>
[email* your-email id:your-email]
<label for="your-message">Your Message</label>
[textarea* your-message id:your-message]
[submit "Send"]

Explanation:

  • : Creates a required text field for the user’s name.

  • [email* your-email]: Creates a required email field.
  • [textarea* your-message]: Creates a required textarea for the message.
  • [submit "Send"]: Adds a submit button.

Step 2.3: Save Your Form

Click Save to store your changes.


Step 3: Configure Email Settings

Step 3.1: Go to the Mail Tab

In the Form Settings, click the Mail tab to define the recipient email address, sender name, subject, and email body. Example:

To: your-email@example.com
From: [your-name] <wordpress@yourdomain.com>
Subject: [your-subject]

Message Body:
From: [your-name]
Email: [your-email]
Message: [your-message]

Step 3.2: Save the Email Settings

Click Save to apply your changes.


Step 4: Embed the Form on Your Website

Step 4.1: Copy the Form Shortcode

Navigate to Contact > Contact Forms, locate your form, and copy its shortcode. Example:

[contact-form-7 id="123" title="Contact form 1"]

Step 4.2: Add the Form to a Page or Post

  1. Go to Pages > Add New or Posts > Add New.
  2. Paste the shortcode where you want the form to appear.
  3. Publish or update the page/post.

Step 5: Customize the Appearance

Step 5.1: Use Custom CSS

Here’s an example of CSS to style your form:

.wpcf7-form label {
    font-size: 16px;
    margin-bottom: 8px;
}
.wpcf7-form input, .wpcf7-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
}
.wpcf7-form input[type="submit"] {
    background-color: #0073e6;
    color: white;
    font-size: 16px;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}
.wpcf7-form input[type="submit"]:hover {
    background-color: #005bb5;
}

Add this CSS to Appearance > Customize > Additional CSS.


Step 6: Test the Form

  1. Visit the page where the form is embedded.
  2. Fill out the form and click Submit.
  3. Check your email inbox for the form submission.
  4. If there are issues, verify your email settings or use an SMTP plugin.

FAQ

1. How do I make a form field required?

Add the * symbol to the field’s shortcode. Example:

[text* your-name]

2. Can I add a CAPTCHA to my form?

Yes! Integrate reCAPTCHA via Contact > Integration and add the [recaptcha] tag to your form.

3. How do I track form submissions?

Flamingo plugin is an ideal companion for Contact Form 7. Here’s how you can use it:

  1. Install and Activate Flamingo:
    • Navigate to your WordPress dashboard.
    • Go to Plugins > Add New.
    • Search for “Flamingo” and click Install Now.
    • After installation, click Activate.
  2. View Form Submissions:
    • After activating Flamingo, a new menu item called Flamingo will appear in your WordPress dashboard.
    • Go to Flamingo > Inbound Messages to view all the form submissions captured from your website.
  3. Detailed Submission Data:
    • Flamingo stores all submitted data, including form fields like name, email, and message.
    • You can filter submissions by contact form or search for specific details using the built-in search feature.
  4. Export Data:
    • If you need a backup or wish to analyze the submissions offline, Flamingo allows you to export form submissions as a CSV file. This is particularly useful for data analysis or maintaining records.
  5. Benefits of Flamingo:
    • Keeps a copy of all submissions in your database, ensuring you don’t lose messages even if there are email delivery issues.
    • Provides an organized and centralized location to review, search, and manage all your form submissions.

 


Conclusion

Contact Form 7 is a powerful and flexible plugin for creating contact forms in WordPress. With features like customization, spam protection, and email notifications, it’s an excellent choice for any website.

Need Expert Help with Contact Form 7?

Hire a certified WordPress expert from Codeable to create, configure, and customize your forms.

Get a Free Estimate