How to Create Dynamic Field Choices

How to Auto-Populate Fields in WordPress Forms

Want to save time by having your form field choices automatically created and updated for you? WPForms makes it easy to include fields based on post-types or taxonomy. In this article, we’ll show you how to do that by creating dynamic field choices.

When to Use Dynamic Field Choices

Existing posts, pages, tags, and categories can provide valuable information for form submissions, allowing you to dynamically populate dropdowns, multiple choice, or checkbox fields.

You can easily ask users to select the appropriate option, without having to input it manually.

These are just a few of the reasons you might use dynamic field choices:

WPForms is the best WordPress Form Builder plugin. Get it for free!
  • Ecommerce – If you have products listed in WooCommerce or other ecommerce, you can ask users to specify the item in question.
  • Real Estate – Users can submit a form with a question about a particular property or related to a specific agent.
  • Services – It will be more efficient for you when customers clarify which services are requested.
  • Frontend Post Submissions – Allow visitors to select from your blog post categories when submitting a post.

Want to add an icon with extra info to a form field? Head over to our tutorial on how to add Tooltips in WordPress forms.

How to Use Dynamic Field Choices

The first thing you need to do is install and activate the WPForms plugin. Here’s a step by step guide on how to install a WordPress plugin.

Also, you’ll need to have a form created. See our tutorial on How to Create a Simple Contact Form as an example to get started.

Now we’re ready to add a dynamic field choice!

Go to your form fields. Add a dropdown, multiple, or checkbox choice field and then click on it in the preview panel at right.

How to Create Dynamic Form Choices

In the Field Options panel at left, under Advanced Options, select the Dynamic Choice option. At this time, you can choose between a Post Type (Posts, Pages, or Custom Post Types) and Taxonomy (Categories or Tags).

Is your site like all the others? Make sure to check out our lists of surprising eCommerce statistics, digital marketing statistics, online form statistics, and online business statistics!

In our example, we’re choosing the Custom Post Type of Products. When you view this form, all published products will be viewable. Users can select which item they are referring to in their form inquiry.

Products Dynamic Dropdown

Final Thoughts

Now you’re all set! You’ve create a form with dynamic fields auto-populated with data from existing content within your website. Now, whenever your post type or taxonomies are updated, the form will be automatically updated along with them.

We hope this tutorial helped you create dynamic field choices in WordPress. You might also want to check out our guide on How to Create a Contact Form Popup in WordPress.

If you like this article, then please follow us on Facebook and Twitter for more free WordPress tutorials.

Using WordPress and want to get WPForms for free?

Enter the URL to your WordPress website to install.


  1. Hi, I wondered if it’s possible to set the post submission category as a default (so each submission auto categorizes, and the post will only show in sections filtered to that category).

    I’ve tried using the dynamic options, but you can’t select a default answer. I’ve also tried using a hidden field with a default setting and linking this through the Meta section on the Post Submission settings form. This way keeps coming back as uncategorized.

    1. Hi Simon,

      We don’t currently have an option for this, but I do agree it would be super useful. I’ve noted this in a feature request so that our team can consider adding an admin-determined category option for post submissions in the future.

      In case it helps in the meantime, you might consider modifying your site’s default post category. This is set to ‘Uncategorized’ when WordPress is installed, but can be changed to any category (under Settings > Writing — here’s a screenshot). I apologize that this isn’t an ideal workaround, but I hope this helps!

      And thanks for the suggestion 🙂

  2. Hi,

    I’m looking to have the drop-down preselected to a choice based on a unique link. I want my users to press a “select” button under an image, then they are brought to the form at the bottom of the page with which ever choice they selected prefilled in the drop down.

    I already have the anchor figured out, now I just need to get the form to auto-populate their choice.


    1. Hi Nick,

      We don’t have a way to have the dropdown field preselected and auto-populate a choice based on a unique link but I’ve made a note on our feature request list so we can keep it on our radar! Thanks for the suggestion 🙂

  3. Hi, is it possible to pull usernames and/or email address in WP Forms from a SQL database? I’m looking for an easier way to import data than manually typing in over 300 employees.

    1. Hi Dan,

      We don’t have a way to do this right now, but I’ve made a note on our feature request list so we can keep it on our radar! Thanks for the suggestion 🙂

      1. I am also very interested in being able to populate fields from an SQL database. I would like users to be able to select an item froman SQL database, brng it up, and view the record. This feature alone could be worth a pro membership. Being able to modify and resubmit as a new record absolutely

      2. Hi there!
        Currently, with WPForms you can dynamically populate Post Types or Taxonomies within the Dropdown, Multiple Choices or Checkbox fields. The option is available under Advanced Options of the fields.
        Unfortunately, we don’t have a built-in option to populate custom data from the database to the form fields. I do agree it would be super helpful, though. I’ve made a note of the feature request and we’ll keep it on our radar as we plan out our roadmap for the future.
        We appreciate your suggestion!
        Have a good one 🙂

  4. I need a custom field to show from the selected dynamic post. Is this in the pipeline? Or is there a way I could hard code it? Thanks

    1. Hi Matt,

      I’m afraid I don’t quite understand what you’re trying to do so can you clarify a bit? Are you trying to get a field to conditionally appear based on the selection a user makes in a dynamic field?

  5. Hi, I have an array that I generated via a JSON request. Let‘s say in the array are like 20 comma separated Names. Can I somehow map the array to a dropdown menu in WpForms?

    1. Hi Michael! Thanks for your comment.

      Currently, we do not have this feature in WPForms. I do agree it would be super helpful, though. I’ve made a note of the feature request and we’ll keep it on our radar as we plan out our roadmap for the future.

      Have a good one 🙂

  6. Suppose I want to create a dropdown field populated by data from a database query and the default value pre-selected using programming code. This is for a form that is used to edit an existing database entry.

    So let’s say I have an entry for employee data and I have a field for which state they come from. So in the form, the dropdown options for State should be created automatically using custom code (without typing in states one by one) and the choice pre-selected by comparison with what’s in the database.

    In short, applying custom smart tags to dropdown or checkbox fields with programatically created choices.

    I have previously done this before using Ninja Forms, although I am having trouble figuring out how to do it with WP Forms. The documentation does not seem to address this situation.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.