Paramclasses Academy - Blog

Tutorials Details

←
Post 23 of 40
→

How to Create Contact Forms in WordPress Using a Form Plugin ?

How to Create Contact Forms in WordPress Using a Form Plugin ?

November 16, 2026

1. Introduction to Contact Forms

A contact form is an important feature of a professional website. It allows visitors to communicate with website owners without directly displaying an email address.

For example, when someone visits a business website, they may want to:

  • Ask about a service.

  • Request a quotation.

  • Submit an enquiry.

  • Report an issue.

  • Request a callback.

  • Send feedback.

Instead of displaying only an email address, we can create a contact form that collects visitor information and sends it to the website administrator.

WordPress provides several form plugins that make this process simple.

In this tutorial, we will use Contact Form 7, a popular free WordPress form plugin.

2. What Is Contact Form 7?

Contact Form 7 is a WordPress plugin that allows users to create and manage contact forms.

It supports different types of form fields and email notification settings.

Important features include:

  • Text fields.

  • Email fields.

  • Telephone fields.

  • Number fields.

  • Date fields.

  • Textarea fields.

  • Dropdown menus.

  • Checkboxes.

  • Radio buttons.

  • File uploads.

  • Form validation.

  • Spam protection integrations.

  • Email notifications.

Official website: https://contactform7.com/

3. How Does a Contact Form Work?

A contact form generally follows this process:

  1. A visitor opens the Contact page.

  2. The visitor enters information into the form.

  3. The visitor clicks the Submit button.

  4. WordPress processes the form submission.

  5. Contact Form 7 validates the submitted information.

  6. If the submission is valid, the plugin attempts to send an email notification.

  7. The website administrator receives the enquiry if email delivery succeeds.

Basic Workflow

Visitor
   |
   v
Contact Page
   |
   v
Contact Form
   |
   v
User Enters Details
   |
   v
Form Validation
   |
   v
WordPress Email Processing
   |
   v
Email Notification
   |
   v
Website Administrator

Important: Successful form submission does not guarantee successful email delivery. Email delivery also depends on your hosting server and email configuration.

4. Requirements Before Creating a Contact Form

Before starting, make sure:

  1. WordPress is installed.

  2. You have administrator access.

  3. Your website has a Contact page or you can create one.

  4. You have an email address for receiving enquiries.

  5. Your hosting environment supports WordPress email delivery.

  6. You have created a website backup.

For this practical tutorial, we will use a WordPress website installed on localhost or hosting.

5. Install Contact Form 7 Plugin

First, we need to install the plugin.

Step 1: Login to WordPress Dashboard

Open your WordPress administration URL:

http://localhost/yourwebsite/wp-admin

Enter your username and password.

Click Login.

Step 2: Open the Plugins Section

From the left sidebar:

  1. Click Plugins.

  2. Select Add New Plugin.

Step 3: Search for Contact Form 7

Enter the following name in the search box:

Contact Form 7

WordPress will display the plugin in the search results.

Step 4: Install the Plugin

  1. Locate Contact Form 7.

  2. Click Install Now.

  3. Wait for the installation process.

Step 5: Activate the Plugin

After installation:

  1. Click Activate.

  2. Wait for activation to finish.

  3. Check the left sidebar.

You should now see a new menu named Contact.

The plugin is successfully installed and activated.

6. Create Your First Contact Form

Now we will create a contact form for our website.

Step 1: Open Contact Forms

Navigate to:

Dashboard → Contact → Contact Forms

Step 2: Create a New Form

Click Add New.

You will see the Contact Form 7 editor.

Enter the form title:

Param Classes Contact Form

Step 3: Understand the Form Editor

The editor generally contains four tabs:

Form: Defines the input fields and form structure.

Mail: Defines how email notifications are configured.

Messages: Controls the messages visitors see after different form actions.

Additional Settings: Allows supported additional form settings.

Step 4: Understand Form Tags

Contact Form 7 uses special tags to create form fields.

For example:

[text* your-name]

This creates a required text field.

[email* your-email]

This creates a required email field.

[textarea your-message]

This creates a message textarea.

The asterisk indicates that the field is required.

You can also use the field generator buttons above the form editor to create tags without manually writing their syntax.

Official documentation: https://contactform7.com/tag-syntax/

7. Create a Professional Contact Form

Now replace the default form template with the following form structure.

Contact Form Template

<div class="contact-form">

    <p>
        <label>Your Name *</label>
        [text* your-name placeholder "Enter your full name"]
    </p>

    <p>
        <label>Your Email *</label>
        [email* your-email placeholder "Enter your email address"]
    </p>

    <p>
        <label>Phone Number</label>
        [tel your-phone placeholder "Enter your phone number"]
    </p>

    <p>
        <label>Subject *</label>
        [text* your-subject placeholder "Enter subject"]
    </p>

    <p>
        <label>Your Message *</label>
        [textarea* your-message placeholder "Write your message"]
    </p>

    <p>
        [submit "Send Message"]
    </p>

</div>

Explanation of the Form Tags

1. Name Field

[text* your-name]
  • text creates a text input.

  • * makes the field required.

  • your-name is the field's internal name.

2. Email Field

[email* your-email]
  • email creates an email input.

  • * makes the field required.

  • The plugin validates the email format.

3. Phone Field

[tel your-phone]
  • tel creates a telephone input.

  • your-phone identifies the submitted value.

  • The field is optional in this example.

4. Subject Field

[text* your-subject]

This collects the subject of the enquiry.

5. Message Field

[textarea* your-message]

This creates a multiline input for the visitor's message.

6. Submit Button

[submit "Send Message"]

This creates the form submission button.

After entering the template, click Save.

8. Configure Email Notifications

Creating a contact form is not enough. We also need to configure where submitted enquiries should be sent.

Step 1: Open the Mail Tab

In the Contact Form 7 editor, click Mail.

You will find several email configuration fields.

Step 2: Configure the To Field

The To field defines the email address that receives form submissions.

Example:

admin@yourwebsite.com

Replace this example with your actual recipient email address.

Step 3: Configure the From Field

Use an email address belonging to your website's domain.

Example:

Param Classes <wordpress@yourwebsite.com>

The sending address should be configured according to your hosting and email provider requirements.

Do not normally use the visitor's email address as the From address. This can cause authentication and email delivery problems.

Step 4: Configure the Subject Field

Enter:

New Contact Enquiry - [your-subject]

The submitted subject will be inserted into the email.

Step 5: Configure Additional Headers

Enter:

Reply-To: [your-email]

This allows the administrator to reply to the visitor using the email address submitted in the form.

Step 6: Configure the Message Body

Use the following template:

You have received a new enquiry from your website.

Name: [your-name]

Email: [your-email]

Phone: [your-phone]

Subject: [your-subject]

Message:

[your-message]

--
This email was sent through the Param Classes contact form.

Step 7: Save the Email Settings

Click Save.

Review the configuration warnings, if any.

The Mail configuration should now use the field names defined in your Form template.

Official documentation: https://contactform7.com/setting-up-mail/

Important Email Security Practice: The From address should generally belong to your website domain. Use the visitor's address in Reply-To. This helps avoid sender spoofing and email authentication problems.

9. Add the Contact Form to a WordPress Page

Now our form is created, but visitors cannot see it until we add it to a website page.

Step 1: Open the Contact Form List

Navigate to:

Contact → Contact Forms

You will see your newly created form.

Step 2: Copy the Form Shortcode

Contact Form 7 generates a shortcode for every form.

Example:

[contact-form-7 id="123" title="Param Classes Contact Form"]

Your actual shortcode will have its own generated ID.

Copy the shortcode displayed on your dashboard.

Step 3: Open the Contact Page

Navigate to:

Pages → All Pages

Find your Contact page.

Click Edit.

Step 4: Add a Shortcode Block

In the WordPress Gutenberg editor:

  1. Click the Add Block (+) button.

  2. Search for Shortcode.

  3. Select the Shortcode block.

  4. Paste your Contact Form 7 shortcode.

You can also use the dedicated Contact Form 7 block when available in the block editor.

Step 5: Update the Page

Click Update.

Now open the Contact page on the frontend.

Your contact form should be visible.

10. Style the Contact Form Using Custom CSS

A default contact form may look simple.

We can improve its appearance using CSS.

Step 1: Open Additional CSS

Navigate to:

Appearance → Customize → Additional CSS

For block themes, the available styling interface may differ. You can also use your theme's supported custom CSS facility.

Step 2: Add the Following CSS

.contact-form {
    max-width: 650px;
    margin: 30px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #2271b1;
}

.contact-form input[type="submit"] {
    width: auto;
    padding: 12px 25px;
    background: #2271b1;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.contact-form input[type="submit"]:hover {
    background: #135e96;
}

Step 3: Publish the CSS

Click Publish or Save, depending on the available interface.

Refresh your Contact page.

Your form should now have:

  • Better spacing.

  • Clean input fields.

  • Rounded corners.

  • Improved button styling.

  • A professional appearance.

11. Configure Form Validation

Form validation ensures visitors enter information in the correct format.

Contact Form 7 provides built-in validation for supported field types.

Examples:

Required Name

[text* your-name]

Required Email

[email* your-email]

Optional Phone

[tel your-phone]

Required Message

[textarea* your-message]

Why Is Validation Important?

Without validation:

  • Visitors may submit incomplete information.

  • Email addresses may be invalid.

  • Important enquiry details may be missing.

Validation improves the quality of submitted information.

However, frontend validation should not be treated as a complete security solution. Always validate and safely process data on the server side in custom development.

12. Configure Spam Protection

Public contact forms can receive unwanted automated submissions.

Spam protection helps reduce these submissions.

Contact Form 7 supports integrations and features such as:

  • Akismet spam filtering.

  • Cloudflare Turnstile integration.

  • reCAPTCHA integration.

  • Disallowed lists.

Example: Cloudflare Turnstile

To configure Turnstile:

  1. Create or open your Cloudflare account.

  2. Register your website in the Turnstile dashboard.

  3. Obtain the site key and secret key.

  4. Open WordPress Dashboard.

  5. Navigate to Contact → Integration.

  6. Open the supported Turnstile integration.

  7. Enter the required keys.

  8. Save the integration.

  9. Test the contact form.

Follow the current integration documentation for the exact setup requirements.

Official documentation: https://contactform7.com/integration-with-external-apis/

13. Configure Email Delivery Using SMTP

Sometimes a contact form displays a successful submission message, but the email never reaches the recipient.

One possible reason is incorrect server email configuration.

WordPress commonly uses its wp_mail() function to send email notifications. Actual delivery depends on the server's mail configuration and the receiving provider.

SMTP stands for Simple Mail Transfer Protocol.

An authenticated SMTP service can provide a more reliable and verifiable email-sending setup.

Basic SMTP Configuration Process

  1. Choose a trusted SMTP or transactional email provider.

  2. Create or configure an authorized sender identity.

  3. Verify your sending domain if required.

  4. Configure SPF and DKIM records according to provider instructions.

  5. Install a compatible SMTP plugin.

  6. Enter the provider's SMTP settings or connect using its supported authentication method.

  7. Save the configuration.

  8. Send a test email.

  9. Check the inbox and spam folder.

Example SMTP Settings

SMTP Host: smtp.example.com

SMTP Port: 587

Encryption: TLS

Authentication: Enabled

Username: Your SMTP Username

Password: Your SMTP Password

These are illustrative settings. Use the actual values provided by your email service.

Never publish SMTP passwords or API keys in frontend code or publicly accessible files.

14. Understand Contact Form Submissions and Storage

An important point for beginners:

Contact Form 7 does not store form submissions in the WordPress database by default.

It processes submissions and attempts to send the configured email.

If you want to store submitted messages inside your WordPress dashboard, you can use the Flamingo plugin from the same developer.

Basic process:

  1. Open Plugins → Add New Plugin.

  2. Search for Flamingo.

  3. Install and activate it.

  4. Open Flamingo from the dashboard.

  5. Review stored inbound messages.

Make sure your privacy policy explains how enquiry information is collected, stored, accessed, and retained.

Official reference: https://contactform7.com/save-submitted-messages-with-flamingo/

15. Troubleshooting Common Contact Form Problems

Problem 1: Contact Form Is Not Visible

Possible reasons:

  • Incorrect shortcode.

  • Form has been deleted.

  • Plugin is inactive.

  • Wrong block has been used.

Solutions:

  1. Open Contact → Contact Forms.

  2. Copy the correct shortcode.

  3. Verify the plugin is active.

  4. Check the Contact page.

  5. Update and refresh the page.

Problem 2: Email Is Not Received

Possible reasons:

  • Incorrect recipient email.

  • Server email configuration issue.

  • SMTP authentication failure.

  • Email marked as spam.

  • Incorrect From address.

Solutions:

  1. Verify the To field.

  2. Check the From field.

  3. Check the spam folder.

  4. Configure authenticated SMTP.

  5. Send a test email.

  6. Review email delivery logs.

Problem 3: Form Submission Shows an Error

Possible reasons:

  • Invalid input.

  • Required field missing.

  • Spam detection.

  • JavaScript conflict.

  • Server-side email failure.

Solutions:

  1. Check required fields.

  2. Review the displayed error message.

  3. Verify spam protection configuration.

  4. Test without conflicting optimization settings.

  5. Check server logs if necessary.

Problem 4: Form Fields Are Not Included in the Email

Possible reason:

The corresponding mail-tag is missing from the Mail template.

For example, if the Form tab contains:

[text your-city]

Then the Mail tab must include:

[your-city]

The field names must match.

Problem 5: Form Layout Is Not Responsive

Possible reasons:

  • Fixed-width CSS.

  • Theme styling conflicts.

  • Incorrect input sizing.

Solutions:

  1. Use width: 100%.

  2. Use box-sizing: border-box.

  3. Avoid unnecessarily large fixed widths.

  4. Test the form on mobile devices.

16. Best Practices for Professional Contact Forms

  1. Collect only the information you actually need.

  2. Use clear and understandable field labels.

  3. Mark required fields properly.

  4. Configure a valid domain-based sender address.

  5. Use Reply-To for the visitor's email.

  6. Configure reliable email delivery.

  7. Add appropriate spam protection.

  8. Test form submissions regularly.

  9. Protect stored personal information.

  10. Maintain a suitable privacy policy.

  11. Avoid unnecessarily large file uploads.

  12. Keep form plugins updated.

  13. Use a backup before making major changes.

  14. Verify mobile responsiveness.

  15. Check that success and error messages are understandable.

17. Practical Assignment: Create a Contact Form for Param Classes

Now create a professional contact form for a training institute website.

Assignment Objective

Create a contact form that allows students to enquire about courses and training programs.

Task 1: Install the Plugin

  • Install Contact Form 7.

  • Activate the plugin.

  • Open Contact → Contact Forms.

Task 2: Create the Form

Create a new form with the following fields:

  • Full Name.

  • Email Address.

  • Phone Number.

  • Course Selection.

  • Subject.

  • Message.

For Course Selection, use a dropdown menu.

Example:

[select* course-selection
"WordPress Development"
"PHP Development"
"React Native"
"Android Development"
"Web Designing"]

Task 3: Configure Email

  • Set the recipient email address.

  • Configure a valid domain-based From address.

  • Add Reply-To.

  • Include all form fields in the email template.

Task 4: Add the Form to a Page

  • Open the Contact page.

  • Insert the Contact Form 7 block or Shortcode block.

  • Paste the generated form shortcode.

  • Update the page.

Task 5: Improve the Design

  • Add custom CSS.

  • Improve spacing and typography.

  • Style the submit button.

  • Test the mobile layout.

Task 6: Test the Complete Workflow

  • Submit a test enquiry.

  • Check the success message.

  • Verify the email notification.

  • Check spam protection.

  • Verify the email delivery process.

Expected Output

At the end of this assignment, you should have:

  • A working Param Classes contact form.

  • Required and optional form fields.

  • A course selection dropdown.

  • Configured email notifications.

  • Responsive form styling.

  • Successful test submissions.

18. Frequently Asked Questions (FAQs)

Q1. What is Contact Form 7?

Contact Form 7 is a free WordPress plugin that allows website owners to create and manage contact forms.

Q2. Is Contact Form 7 free?

Yes. Contact Form 7 is an open-source WordPress plugin available through the official WordPress Plugin Directory.

Q3. Can I create multiple contact forms?

Yes. You can create multiple forms for different purposes, such as general enquiries, course enquiries, support requests, and feedback.

Q4. Can I add a phone number field?

Yes. You can use the tel form-tag.

Q5. Can I add a dropdown menu?

Yes. Contact Form 7 supports dropdown menus through the select form-tag.

Q6. Can I receive contact form messages in Gmail?

Yes. You can configure a suitable email delivery service or authenticated SMTP connection to deliver notifications to your Gmail address.

Q7. Does Contact Form 7 save submitted messages?

No. It does not store submissions by default. You can use Flamingo if you need to store messages in WordPress.

Q8. Why are contact form emails not delivered?

Possible reasons include incorrect mail settings, server restrictions, authentication problems, or spam filtering.

Q9. Can I customize the design of Contact Form 7?

Yes. You can use custom CSS to style form fields, labels, buttons, and messages.

Q10. Is Contact Form 7 suitable for business websites?

Yes. It is suitable for many business websites that need basic and moderately customized contact forms.

19. Conclusion

Contact forms are an important communication feature for professional WordPress websites.

In this tutorial, you learned how to:

  • Understand contact forms.

  • Install Contact Form 7.

  • Create a custom contact form.

  • Add different types of form fields.

  • Configure email notifications.

  • Add forms to WordPress pages.

  • Style forms using CSS.

  • Configure validation and spam protection.

  • Understand SMTP email delivery.

  • Store submissions using Flamingo.

  • Troubleshoot common contact form problems.

By completing the practical assignment, you will have hands-on experience creating a professional enquiry form for a WordPress website.

←
Post 23 of 40
→