WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Use Dynamic Field Population in WordPress to Auto-Fill Forms

How to Use Dynamic Field Population in WordPress to Auto-Fill Forms

Last updated on January 7th, 2020 by Editorial Staff
80 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Use Dynamic Field Population in WordPress to Auto-Fill Forms

Do you want to use dynamic field population in WordPress to auto-fill forms on your website?

Dynamic field population allows you to automatically fill form fields based on user selection, query strings, or field type.

This makes your forms smart, saves users time, deliver a better user experience, and ultimately improves form completion rate.

In this article, we’ll show you how to use dynamic field population in WordPress to auto-fill forms.

Automatically fill form fields in WordPress with Dynamic field population

What is Dynamic Field Population?

Dynamic field population is a technique that allows website owners to automatically fill form fields based on user selection, form type, query strings, or conditional logic.

For example, an eCommerce store can create a form where product field in the form is dymanically populated using existing products in WooCommerce or any other eCommerce software.

Similarly, a real estate website can automatically populate listings, agents, property type fields in their appointment and lead generation forms.

Advanced users and developers can also use URL parameters to dynamically fill out form fields using smart links from email newsletter or other website interactions.

Having said that, let’s take a look at how to easily use the dynamic field population in WordPress.

How to Use Dynamic Field Population in WordPress

First, thing you need to do is install and activate the WPForms plugin. For more details, see our step by step guide on how to install a WordPress plugin.

WPForms is the best WordPress contact form plugin on the market. It allows you to easily create online forms using a simple drag and drop tool.

It also comes with dynamic field population, conditional logic, and advanced form fields. Together, these features allow you to create smarter and interactive forms for your website.

Note: WPForms is co-founded by WPBeginner founder, Syed Balkhi.

Upon activating the plugin, you need to visit the WPForms » Settings page to enter your license key. You can find this information under your account on the WPForms website.

WPForms License key

Next, you need to visit WPForms » Add New to create your first form. You’ll be asked to provide a name for your form and then select a template to start.

Creating a new form

WPForms will now load your form with pre-selected fields. You can click to edit form fields or use drag and drop feature to move them up and down. You can also add and remove form fields with just a click.

Let’s add a new form field to populate it with dynamic choices.

You can add a dropdown, multiple-choice, or a checkbox field to your form to use dynamic choices options. Simply click on a field from the left column to add it to your form.

Add form fields

Next, click to edit the field and then expand the Advanced Optins menu from the left column.

Advanced options

From here, you need to select a dynamic option under Dynamic Choices. WPForms supports post types and taxonomies registered on your WordPress site. For the sake of this tutorial, we’ll select Products post type.

Dynamic choices

WPForms will now automatically load and display the fields in the form preview.

You can now save your form and exit the form builder.

To add the form in a WordPress post or page, simply edit the post or page where you want to add it.

On the post edit screen, add WPForms block to your post edit area. After that select the form you created earlier from the drop down menu.

Adding WPForms block in WordPress

You can now save your post or page and visit your website to see your form with dynamic field values in action.

WPForm preview

Automatically Fill Form Fields Using URL Parameters

WPForms also allows you to dynamically fill form fields using URL parameters. This allows you to create smart links that automatically pass down information to the form and fill it for your users to submit.

First, you need to create a new form or edit an existing form in WPForms. Once you are done creating your form, switch to the settings tab from the left column and then select the ‘General’ tab.

On this screen, you need to check the box to Enable dynamic field population.

Enable dynamic fields

You can now save your form and exit the form builder. Your form is now ready to dynamically populate form fields using URL parameters.

Creating Links with URL Parameters

WPForms accepts dynamic form fields passed through URL parameters in a specific format.

https://example.com/contact/?wpf15_1=value

Let’s break it down.

  • The part of the URL before the question mark ‘?’ is the URL of the page that has your form. For example, your contact form page.
  • ?wpf – Indicates the start of the WPForm form field parameters.
  • 15 – Is the ID of your form
  • _1 – Next you have the field ID
  • =value – = indicates the start of the value you want to pass to the form followed by the actual field value.

Here is an example of a URL where we are passing a product title as a text field to a feedback form.

https://example.com/contact/?wpf15_2=Vintage%20Flower%20Vase

Adding URL to your post

Notice, how we have used %20 to indicate spaces between words in the product title.

Finding Form and Field IDs in WPForms

In order to create URL parameters, you’ll need to know the form and field IDs. Here is how you can find these values.

Simply edit your form, and you will see the form ID in your browser’s address bar.

Finding form ID in WPForms

Similarly, in order to find the form field ID, you need to just click to edit it. You will see form field properties in the left column along with field ID at the top.

Finding the form field ID

Now, what if you wanted to pass a value to a subfield?

Simply add the subfield identifier after the field ID in your URL like this:

https://example.com/contact/?wpf15_3_city=london

For more details, see WPForms developer documentation which shows more examples to use different parameters for all types of form fields.

You can now use this feature in combination with your CRM software or email marketing service to send smart form links to your users. Most marketing platforms come with their own personalized MERGE tags that you can add in the smart URL to automatically fill personal information in the form.

You can also use dynamic field population feature with other form plugins like Formidable Forms, Gravity Forms, etc. However, we recommend using WPForms because it makes the whole process easy, and we know it well because we built the product.

We hope this article helped you learn how to use the dynamic field population in WordPress to auto-fill forms. You may also want to see our article on how to track and reduce form abandonment in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

80 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

Comments

  1. Congratulations, you have the opportunity to be the first commenter on this article.
    Have a question or suggestion? Please leave a comment to start the discussion.

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
Smash Balloon
Smash Balloon
Add Custom Social Media Feeds in WordPress. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
Complianz
Complianz GDPR Coupon
Get 15% OFF on Complianz GDPR premium WordPress privacy suite plugin.
Connections Pro
Connections Pro Coupon
Get 15% OFF on Connections Pro WordPress directory plugin.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.