
Conditional fields let a Contact Form 7 inquiry ask for different details according to an earlier answer. The independent Conditional Fields for Contact Form 7 plugin provides a group-and-rule approach for that job. A reliable setup needs matching mail output and a deliberate policy for answers that remain in a group after it becomes hidden.
Define the smallest useful branch
Write the question and two branches before installing more features. For example, an inquiry type might be “Project” or “Support.” A project request needs a short scope description; a support request needs a reference code. Keep the visitor’s name and reply address outside both branches because they apply to either route.
Do not use conditional display to solve department routing, access permissions, or trusted pricing. Those are separate requirements. Our recipient routing guide addresses the first. This tutorial changes what questions appear, while preserving one form and one deliberately configured notification.
Install the independent extension
Use the official Conditional Fields for Contact Form 7 listing by Jules Colle. The extension is independent of the CF7 developers. Verify its requirements and compatibility with your installed versions, then work in a controlled staging environment. Do not install a similarly named addon and assume its syntax will match this example.
The free plugin includes conditional groups and handling for required fields inside hidden groups. Its listing identifies repeaters, multiple steps, calculated fields, and other advanced capabilities as Pro features. This guide uses the basic group workflow and does not require those paid functions. Review the vendor’s current edition details before expanding it into a quote calculator or complex application.
Create uniquely named fields and groups
Add the branch selector and two groups to the Form tab. These are illustrative names; choose stable names that fit your existing integration mappings. Every field needs a unique name even if two groups never appear together.
<label>Inquiry type
[select* inquiry-kind first_as_label "Choose a type" "Project" "Support"]</label>
[group project-details]
<label>What should the project accomplish?
[textarea* project-scope]</label>
[/group]
[group support-details]
<label>Your support reference
[text* support-reference]</label>
[/group]
<label>Your email
[email* reply-address]</label>
[submit "Send inquiry"]
Use the extension’s group generator when you want help assembling the opening and closing tags. Keep the HTML valid and the labels inside the appropriate group. A malformed wrapper can complicate both display and validation. The native dropdown itself is explained in our CF7 dropdown guide.
Add explicit show rules
In the extension’s Conditional fields tab, create a rule showing project-details when inquiry-kind equals Project, and another showing support-details when it equals Support. Match the actual option value, including its spelling. Save the form and confirm the public page refers to that same form record.
Begin with the neutral prompt selected. Neither branch should ask the visitor for an answer before a type is chosen. Then select each route and check that its group becomes visible while the other stays hidden. If you later use pipe values or translated choices, recheck which value the rule compares; visible wording and submitted values can differ.
Prefer this small rule set to several overlapping conditions. Write down what happens for every available choice. If a new option has no rule, the form should have an intentional result rather than an accidental state with no relevant questions.
Make the notification follow the same branch
The extension supports group wrappers in the Mail template too. Form syntax closes a group with [/group]; mail syntax closes the named group. Keep those contexts separate:
Inquiry type: [inquiry-kind]
Reply address: [reply-address]
[project-details]
Project scope: [project-scope]
[/project-details]
[support-details]
Support reference: [support-reference]
[/support-details]
Inspect a captured email for both routes. The intended branch should appear with its label and submitted value, while unrelated sections should be absent. A correct screen does not prove the email template is correct. Apply the same review to an autoresponder or any separate export mapping you maintain; the extension’s mail behavior does not establish identical behavior in every connector.
Decide what happens when an answer becomes hidden
The plugin’s listing explains that fields are hidden rather than removed, so their names must remain unique. Its tutorial also describes a Clear on hide group option. Decide whether changing routes should erase previous branch answers or preserve them if the visitor switches back.
For a short inquiry form, clearing a discarded branch may reduce confusing downstream values, but it also removes work the visitor entered. Explain that behavior where it matters and test it before release. For a longer form, retaining answers can be useful, provided the final notification and any integration distinguish active from inactive branches.
Hidden controls are not a confidentiality or authorization boundary. A developer can inspect or alter client-side values, and a server-side connector may receive more than the visible branch. Validate any consequential business decision on the server. Do not trust a hidden price, entitlement, or department selection merely because the normal interface hid it.
Test transitions, validation, and reset behavior
Prepare cases for the neutral prompt, each route, an empty required answer in a visible group, and switching routes after typing. The extension documents that required fields inside hidden groups should not trigger validation errors. Verify that behavior in your installed stack rather than assuming another addon or custom validator cannot interfere.
Also test going backward after a validation error and resetting after success. Review keyboard navigation and labels as groups appear. Keep synthetic content in a captured-mail environment and record the observed output. These are recommended checks, not claims that we ran them against your production form.
If groups always appear or never respond, inspect browser errors and script loading. The vendor notes that its scripts depend on the theme’s footer execution. Investigate optimization or theme conflicts in staging; do not start by stripping scripts from a working production page. Use our reset troubleshooting guide for widget and default-state issues.
Keep analytics aligned with the question
Document the branch field, active options, and the date rules changed. An increase in support inquiries can reflect a changed dropdown default rather than new demand. Keep form-level submission counts separate from any branch-level information provided by your actual storage or reporting tools.
Review the official free Svetlik Analytics for Contact Form 7 listing for its documented measurement scope. Do not assume the conditional-fields extension adds funnel or abandonment reports. Start with a simple working branch, verified notification, and explicit data mapping before adding more complexity.
