Setting Up a WordPress Contact Form with CF7 or WPForms

In this Q&A session we guide you through creating a contact form in WordPress using popular plugins Contact Form 7 and WPForms. You’ll see steps for installation, form tag setup, email notifications and shortcode placement. The answers also cover optional spam protection and a note on GDPR compliance.

Help me set up a contact form in WordPress

Option 1: Using Contact Form 7

Contact Form 7 is free, flexible, and widely used.

  1. Installation:
    • Go to Plugins > Add New in your WordPress dashboard.
    • Search for “Contact Form 7”.
    • Click Install Now and then Activate.
  2. Create a Form:
    • Go to the Contact menu in your admin screen.
    • Edit the default form or click Add New to make another.
    • Use simple tags for fields. Example:
    <label> Your Name (required)
        [text* your-name] </label>
    
    <label> Your Email (required)
        [email* your-email] </label>
    
    <label> Subject
        [text your-subject] </label>
    
    <label> Your Message
        [textarea your-message] </label>
    
    [submit "Send"]
  3. Configure Email Settings:
    • Switch to the Mail tab in the form editor.
    • Set To, From, Subject, and the body.
    To: your-email@example.com
    From: [your-name] <wordpress@your-domain.com>
    Subject: Contact Form Submission from [your-subject]
    
    Message Body:
    From: [your-name] <[your-email]>
    Subject: [your-subject]
    
    Message:
    [your-message]
    
    --
    This e-mail was sent from a contact form on Your Site Name (your-website.com)

    Replace your-email@example.com with your address. Use a wordpress@your-domain.com format for the From field to help avoid spam filters.

  4. Add the Form to a Page:
    • Copy the shortcode at the top (e.g., [contact-form-7 id="123" title="Contact form 1"]).
    • Paste it into the page or post where you want the form.
  5. Protect with reCAPTCHA (Optional):
    • Insert the [cf7sr-turnstile] shortcode above the submit button to add Cloudflare Turnstile CAPTCHA.

Option 2: Using WPForms

WPForms provides a drag-and-drop builder.

  1. Installation:
    • Go to Plugins > Add New.
    • Search for “WPForms”.
    • Click Install Now and then Activate.
  2. Create a Form:
    • Go to WPForms > Add New.
    • Choose a blank form or a template like “Simple Contact Form”.
    • Use the builder to add, remove, and arrange fields.
  3. Configure Email Notifications:
    • Go to Settings > Notifications.
    • Set the notification email address, subject line, from name, from email, and message.
  4. Add the Form to a Page:
    • Click the Embed button in the builder.
    • Select or create a page; WPForms adds the form automatically.
    • Or copy the shortcode and paste it into any post or page.
  5. Spam Protection:
    • WPForms has built-in spam protection.
    • You can also add hCaptcha or Google reCAPTCHA.

General Tips

  • Test the form to confirm submissions are sent correctly.
  • Check mobile responsiveness on smartphones and tablets.
  • If you collect personal data from EU users, add a consent checkbox and a link to your privacy policy for GDPR compliance.

Need human WordPress help?

WP Assistant is a free tool created by Atiba Software, a WordPress design and development company located in Nashville, TN. If you need more personalized WordPress assistance let us know, and we’ll get back to you ASAP!