Hosting & WordPressOctober 23, 2026

Contact Form 7 does not include conditional logic out of the box, so the way to add it is with a dedicated add-on such as Conditional Fields for Contact Form 7. Once the add-on is active, you wrap the fields you want to show or hide in named groups, then write rules that connect a visitor’s answer to a group — pick “delivery” and the address fields appear, pick “pickup” and they stay hidden. Learning how to add conditional logic in Contact Form 7 this way lets you keep the visible form short while still collecting every detail you need behind the scenes.

Shorter forms convert better because every question on screen feels relevant to the answer just given. A quote form that asks for project dates only after a visitor picks “installation”, or company details only for business enquiries, feels like a conversation rather than an interrogation. This guide walks through the full setup: installing the add-on, planning your rules on paper, building groups, dodging the required-field trap that breaks so many conditional forms, and testing every answer path before the form goes live.

How to Add Conditional Logic in Contact Form 7 With a Plugin

The add-on introduces one new idea to the form editor: groups. Any fields placed inside a group can be shown or hidden as a single block, and rules decide when each group appears. Build in this order — fields first, groups second, rules last — and the whole setup stays readable even when a form grows to twenty fields and six groups.

  1. Install a conditional fields add-on. From the WordPress dashboard go to Plugins → Add New, search for “Conditional Fields for Contact Form 7”, install it, and activate it. The form editor gains a group tag you can insert around any set of fields.
  2. Create all your normal fields first. Add every question the form needs, including the ones that will later live inside groups. Get the field names, labels, and option values right now, because renaming them later can break the rules that point at them.
  3. Wrap the optional sets in groups. Surround each conditional set with a group tag and give it a descriptive name, such as group-delivery or group-business-details. A form with six groups called “group-1” through “group-6” becomes impossible to debug three months later.
  4. Write one rule per group. Each rule states a condition and an outcome: show group-delivery when the “How would you like to receive this?” field equals “Delivery”. One clear rule per group beats a tangle of overlapping conditions.
  5. Decide the default state. Most groups should start hidden and appear only when triggered. A group that starts visible and vanishes mid-form confuses visitors who already started reading it.
  6. Check required fields inside groups. A required field inside a hidden group is the classic failure: the visitor cannot see it, cannot fill it, and the form refuses to submit. Confirm your add-on skips validation for hidden fields, and test it rather than trusting the description.
  7. Save, then test every path. Submit the form once for each possible trigger answer, on desktop and on a phone, and read the notification email each time.

One practical detail catches people out: the value a rule matches is the option’s stored value, not always the label shown on screen. If your dropdown shows “Yes, please” but stores “yes”, the rule must match “yes”. Check the form editor’s option values before writing rules, and keep labels and values identical where you can — it removes a whole class of silent mismatches.

Conditional fields plugin settings showing a rule that reveals a group when an option is selected

Plan Your Conditional Logic Before You Build

Good conditional forms start on paper, not in the plugin settings. List each trigger question and write down what should appear for every possible answer. A five-option dropdown means five outcomes to plan, and sketching them in advance is what stops you building a rule, testing it, finding a gap, and rebuilding it three times.

Pick Triggers That Behave Predictably

Radio buttons and dropdowns make the cleanest triggers because each one produces exactly one predictable value. A visitor picks one option, the rule matches, the group appears — no ambiguity. Checkboxes can work too, but multiple selections create combinations that multiply fast: three ticked boxes can mean eight different states. Keep checkbox-driven logic simple, such as revealing a details box when a single box is ticked, and resist the urge to chain conditions off several checkboxes at once.

Text fields make poor triggers. Free-text answers are unpredictable, so a rule that depends on someone typing a specific word will fail more often than it works. If a text answer genuinely changes what you need to ask, restructure the form so a dropdown or radio choice comes first and the text field follows inside the revealed group.

Watch Out for Chained Rules

Chains happen when a revealed field becomes the trigger for another group: pick “Business enquiry” and the company-details group appears, then pick “Limited company” inside it and a registration-number field appears. Chains are powerful — they guide a visitor through a genuine decision tree — but each link has to be tested in both directions. The failure mode is a visitor changing their first answer after filling in a chained group: the second group hides, but its values may still sit in the submission. Decide in advance whether hidden values should be cleared or ignored, and test the exact sequence of changing an answer mid-form.

Required Fields and Validation Traps

The most common conditional logic disaster is a required field sitting inside a hidden group. The visitor cannot see it, cannot fill it, yet the form refuses to submit and gives them no useful explanation. They try again, it fails again, and they leave. Quality add-ons automatically relax validation for hidden fields, but verify this with a real test submission rather than assuming the feature works as described on the plugin page.

There is a second, quieter trap in the email settings. If your notification template lists fields from a group that stayed hidden, the email arrives with blank gaps that look like errors to whoever reads it. Format the message so conditional sections read naturally when present and vanish cleanly when absent — short labelled lines work better than long paragraphs with gaps in the middle. Sending yourself a test email for every main answer path is tedious, but it catches exactly the problems your visitors would otherwise report as lost enquiries.

Validation also deserves a look at the other end: fields that are optional when hidden but required when shown. Some add-ons handle this automatically, others need the rule written to toggle the requirement. If your setup offers a “required only when visible” setting, use it. If it does not, test the combination explicitly — a group that appears and submits happily with its required field empty is a data-quality hole, not a feature.

Contact form revealing extra service questions after a visitor picks a service type

Practical Examples That Lift Completion Rates

A service enquiry form shows conditional logic at its best. Ask what the visitor needs first, then reveal only the follow-ups for that service: project dates for installations, the current provider for migrations, or property size for cleaning quotes. Visitors feel the form respects their time because every visible question is obviously relevant to the answer they just gave. Forms commonly shrink by a third on screen while collecting more useful information than the static version did.

Patterns Worth Copying

Several patterns show up again and again on high-converting forms. Showing a company-details group only for business enquiries keeps personal enquiries short. Revealing an “Other, please explain” text box when someone picks Other captures answers your list missed without cluttering the form for everyone else. Displaying event fields such as guest count only for event-related reasons keeps the form focused. And a delivery-versus-pickup choice that reveals an address group only for delivery is the textbook example — simple, obvious, and immediately useful.

These patterns work best combined with the other Contact Form 7 features your form already uses. A signature field inside a conditional group, for instance, only appears for the enquiry types that need one. A repeater field in Contact Form 7 can sit inside a group too, letting visitors add extra rows — extra attendees, extra products — only when the enquiry type calls for them. Keep each group focused on one job, and the form stays manageable no matter how many patterns you stack.

Measure the Difference

Conditional logic is easy to justify when you measure it. Record the form’s completion rate before the change — submissions divided by form views — then compare the same figure a month after. A drop in abandoned forms is the number that matters, not the raw submission count, which can move for unrelated reasons. If completion improves but the quality of enquiries falls, a group may be hiding a question your team actually needs; add it back as a visible field and re-measure.

Testing and Maintaining Conditional Forms

Test methodically: for every trigger, choose each possible answer and confirm the right groups appear, the wrong ones stay hidden, and the form submits successfully. Repeat the whole pass on a phone, because a rule that works on desktop can still look broken if revealed fields overflow a small screen or a dropdown behaves differently on touch. Keep a simple checklist saved with your site notes so future editors repeat the same tests instead of relying on memory.

Maintenance matters because conditional forms break quietly. When anyone edits the form, renames a field, or changes a dropdown option value, the connected rules may silently stop matching — the form still loads, still looks fine, and simply never reveals the group. Re-run your checklist after every edit, and after every Contact Form 7 or add-on update. A form that looks fine but hides the wrong fields is worse than a long static form, because at least the static form collects the answers.

One habit saves more debugging time than any other: keep a one-page note listing every group, its trigger, and its rule. When a rule misbehaves six months from now, that note tells you exactly where to look instead of forcing you to reverse-engineer the whole form. Pair it with a test submission after each change and your conditional form stays reliable for years.

Testing a conditional form by checking each answer path on desktop and mobile

Once the logic is working, finish the visitor experience properly: after a successful submission, send people somewhere useful instead of leaving them on the same page. Our guide to redirecting Contact Form 7 to a thank you page covers that final step.

Frequently Asked Questions

Does Contact Form 7 support conditional logic natively?

No. Contact Form 7 ships with standard fields and basic validation but no show or hide rules. A dedicated add-on provides group wrappers and rule building, after which you can reveal or hide whole field groups based on dropdowns, radio buttons, and other answers, all without writing custom code for typical cases.

Can hidden fields still be required?

They should not be. A well-behaved conditional add-on skips validation for fields in hidden groups, so visitors are never blocked by questions they cannot see. Always verify this with a test submission where a group containing a required field stays hidden, and confirm the form submits and the email looks correct.

What are the best fields to use as triggers?

Dropdowns and radio buttons make the most reliable triggers because each produces one predictable value. Checkboxes work when the logic is simple, such as revealing a details box when a box is ticked, but complex multi-checkbox combinations become hard to test and maintain as the form grows.

Will conditional logic slow my form down?

No, not noticeably. The show and hide behaviour runs with a small script in the visitor’s browser, and the groups are already present in the page, simply hidden until triggered. In practice, completion rates usually improve because the visible form is shorter, which far outweighs the trivial script cost.

What happens if a visitor changes their answer after filling in a revealed group?

The group hides again, and what happens to its values depends on the add-on: most either clear the hidden values or exclude them from the submission. Test this exact sequence yourself, because a stale value from a changed answer can reach your inbox and confuse whoever follows up.

Sarah Mitchell
Written by Sarah Mitchell

Sarah is a web hosting specialist with 8 years of experience running WordPress sites. She writes practical hosting and WordPress guides.

Similar Posts