‹ BACK TO BLOG

Conditional Logic in WordPress Forms: Complete Guide (2026)

Not every question on a form applies to everyone. If a job applicant tells you they have no work experience, asking how many years they have just gets in their way.

Conditional logic fixes that. It lets a form react to what someone has already answered, so a field appears only when it matters and stays out of the way when it does not.

In SureForms, the idea goes further than showing and hiding fields. The same kind of rule can decide whether the submit button appears, which notification email gets sent, which confirmation message or redirect a visitor sees, and whether a submission is passed on to your CRM or a webhook.

This guide covers all of it. You will build a working example step by step, learn how operators and AND/OR rules work, see eight practical use cases with the exact place each one is set up, and get a troubleshooting checklist drawn from SureForms’ own documentation and release notes.

What Is Conditional Logic in Forms?

Conditional logic is a set of if-then rules on a form. If a visitor gives a certain answer, then the form does something in response: it shows a field, hides a field, or changes what happens after the form is submitted.

SureForms’ documentation gives a simple example. Someone signs up for a service and selects “Business Account.” The form shows fields for business details. If they choose “Personal Account,” those business fields stay hidden.

The benefits follow directly from that behavior:

  • The form feels shorter. Visitors are not faced with fields that do not apply to them.
  • It is faster to complete. Fewer irrelevant fields means fewer places to hesitate.
  • The data is cleaner. When people only see relevant questions, the answers you collect are more accurate.

Show Logic vs. Hide Logic

Every field rule in SureForms starts with a sentence you complete: “Show this field if…” or “Hide this field if…”. You choose Show or Hide from a dropdown in the field’s settings.

A Show rule keeps a field out of sight until the condition is true. A Hide rule keeps a field visible until the condition is true. Which one is simpler depends on your form. If a field is needed for only one answer, Show is usually the shorter rule. If a field is unnecessary for a few specific answers, Hide can be.

Watch the Walkthrough

If you prefer to watch before you read, this video builds the same job application form used in the steps below: one rule that shows a field, and one that hides a field.

This content is blocked because it requires YouTube cookies.

Where Conditional Logic Works in SureForms

Most guides treat conditional logic as a show-and-hide feature for fields. In SureForms there are at least seven places where you can put a rule, and each one has its own setup.

WhereWhat it controlsWhere you set it upHow conditions combine
FieldsWhether a field is shown or hiddenThe field’s Advanced tab, Conditional Logic, Configure ConditionsAND and OR groups
Submit buttonWhether the submit button appearsA Custom Button field: Advanced tab, Conditional Logic, Configure ConditionsAND and OR groups
Notification emailsWhether a notification email is sentForm Settings, Email Notification, Add Trigger ConditionsAny or All
ConfirmationsWhich success message or redirect a visitor getsForm Settings, Conditional ConfirmationsAll (the default) or Any
IntegrationsWhether data is sent to a connected toolForm Settings, Integrations, Add Trigger ConditionsAny or All
WebhooksWhether a webhook firesForm Settings, Integrations, Webhooks, Add Trigger ConditionsAny or All
Post FeedsWhether a post is created from a submissionThe feed’s trigger conditionsAll or Any

Field Show and Hide Rules

This is the classic use. A rule on a field decides whether that field is visible. It is covered in detail in the step-by-step section below, and in SureForms’ guides on how to use conditional logic and creating forms with conditional logic.

Fields in Multi-Step Forms

Rules also work on fields inside multi-step forms, where a Page Break block splits the form into steps. If every field on a step is hidden by your rules, SureForms skips that step automatically, so visitors never land on an empty page.

Submit Button Rules

You can keep the submit button hidden until a condition is met. This works through a Custom Button field rather than the default submit button, and it is set up the same way as any other field: select the Custom Button, open its Advanced tab, then Conditional Logic, then Configure Conditions. The Custom Button block is available in the free plugin, but conditional logic on it needs SureForms Premium, version 2.12.0 or later. SureForms’ documentation on hiding the submit button using conditional logic covers the setup.

Notification Email Rules

Notification emails have a setting called Add Trigger Conditions. With it on, an email is sent only when the conditions you set are met. See SureForms’ guide to adjusting form notification emails.

Confirmation Rules

Conditional Confirmations let you show a different success message, or redirect to a different page or URL, depending on what the visitor submitted. See Conditional Confirmations in SureForms.

Integration Rules

Conditional logic for integrations controls when an integration runs, using Add Trigger Conditions in the integration’s settings. If the conditions are not met, the integration is skipped. This applies to the supported integrations, including CRMs and email tools. See Conditional Logic with Integrations.

Webhook Rules

Webhooks have their own Add Trigger Conditions setting, so a webhook fires only for the submissions you choose. See Webhook Conditional Logic and the main webhooks guide.

Post Feed Rules

If you use Post Creation to turn submissions into posts or custom post types, a post feed has its own trigger conditions, so a post is created only when your conditions are met. See SureForms’ guide to adding custom posts using SureForms. SureForms’ release notes also mention conditions on field restrictions, which this guide does not cover.

Which Plan Includes It

Conditional logic is a SureForms Premium feature, and it is included in every Premium plan. Plans differ only in how many sites you can use them on, and all come with a 14-day money-back guarantee. The pricing page always shows the current plans and prices.

See SureForms Premium plans and pricing

How to Set Up Conditional Logic in SureForms (Step-by-Step)

The steps below use a job application form with seven fields: Full Name, Email, Position Applied For, Do You Have Prior Experience?, Years of Experience, How Did You Hear About This Job? and Please Specify. You will add two rules to it:

  1. Show Years of Experience only when Do You Have Prior Experience? is Yes.
  2. Hide Please Specify when How Did You Hear About This Job? is LinkedIn, Job Board or Referral.
SureForms editor showing part of the job application form: Position Applied For, Do You Have Prior Experience, Years of Experience, How Did You Hear About This Job and Please Specify

Before any rules, every visitor sees every field. Picking No for prior experience still shows Years of Experience, and picking Job Board still shows Please Specify.

Rule 1: Show Years of Experience Only When the Answer Is Yes

Step 1: Open your form and select the field you want to control

Go to SureForms, then Forms, and open your form in the editor. Click the field that should appear or disappear. In this example that is Years of Experience.

The rule lives on the field it controls, not on the field the visitor answers.

Step 2: Open the Advanced tab

With the field selected, open the Block tab in the right sidebar, then click the Advanced tab.

Step 3: Turn on Conditional Logic

In the Conditional Logic section, switch on Enable Conditional Logic. Two things appear: a sentence that reads “Show this field if,” with a Show dropdown, and a Configure Conditions button.

The Advanced tab of a Number field in SureForms with the Enable Conditional Logic toggle switched on, a Show dropdown and a Configure Conditions button

Leave the dropdown on Show for this rule.

Step 4: Open Configure Conditions

Click Configure Conditions. A window titled Configure Conditional Logic opens with one empty rule: a field dropdown, an operator dropdown (set to “is” by default), a value box, an And button and a trash icon. Below the rule is an OR Group button, and at the bottom are Cancel and Set Rules buttons.

The Configure Conditional Logic window in SureForms showing a field selector, an operator set to is, a value box, an And button, a trash icon, an OR Group button, and Cancel and Set Rules buttons

Step 5: Build the condition

Choose the field the rule should watch: Do You Have Prior Experience? Keep the operator as is, and choose Yes as the value. When the field you pick is a Dropdown, the value box becomes a dropdown you choose from.

Step 6: Click Set Rules and save the form

Click Set Rules, then save the form in the editor. After you set the rules, the field’s sidebar shows a stacked summary of the rule: the field, the operator and the values. Once the form is saved, a Form updated notice appears with a View Form link.

Step 7: Test it on the front end

Open the form on the front end and try both answers. Choose Yes and Years of Experience appears.

Front end of the job application form with Yes selected for prior experience and the Years of Experience field now visible

Choose No and it disappears.

Front end of the job application form with No selected for prior experience and the Years of Experience field no longer visible

Rule 2: Hide Please Specify for Three Specific Answers

The second rule works on the field Please Specify, which has the help text “If selected ‘Other’, please specify.” It only matters when the answer is Other, so we hide it for the other three answers.

Step 1: Select Please Specify and open its Advanced tab

Click the Please Specify field, open the Advanced tab and turn on Enable Conditional Logic.

Step 2: Switch the dropdown to Hide

Change the first dropdown from Show to Hide. The sentence now reads “Hide this field if.”

Step 3: Build the condition with “is one of”

Click Configure Conditions. Choose How Did You Hear About This Job? as the field and is one of as the operator. Then select LinkedIn, Job Board and Referral as the values.

“Is one of” lets a single rule cover several answers. Without it, you would need a separate condition for each answer.

Step 4: Set the rules, save and test

Click Set Rules and save the form. The sidebar now shows a stacked summary: the field (How Did You Hear About This Job?), the operator (is one of) and the values (LinkedIn, Job Board, Referral).

The Advanced tab of the Please Specify text field with Conditional Logic set to Hide and a stacked rule summary showing How Did You Hear About This Job, is one of, and LinkedIn, Job Board, Referral

On the front end, choosing LinkedIn, Job Board or Referral hides Please Specify.

Front end of the job application form with Referral selected and the Please Specify field hidden

Choosing Other brings it back.

Front end of the job application form with Other selected and the Please Specify field visible

Both rules took a few clicks each, with no code. You can see the whole sequence in the video above.

Choosing an Operator

The operator decides how a visitor’s answer is compared with the value you set. For field rules there is no single shared list. The operators you see depend on the type of field the rule is watching.

Field typeOperators
Text fieldsis, is not, is empty, is not empty, contains, does not contain, starts with, ends with, matches RegEx pattern, does not match RegEx pattern
Number fieldsis, is not, is greater than, is greater than or equal to, is less than, is less than or equal to, is between, matches RegEx pattern, does not match RegEx pattern
Dropdown and Multiple Choice fieldsis, is not, is one of, is not one of, is selected, is not selected, matches RegEx pattern, does not match RegEx pattern
Checkbox fieldsis checked, is not checked, matches RegEx pattern, does not match RegEx pattern
Date pickersis, is before, is on or before, is after, is on or after
Time pickersis, is before, is on or before, is after, is on or after
The Dropdown field, for example, has eight operators, including the two RegEx options. The screenshot below shows the start of that list.

The operator dropdown in the SureForms Configure Conditional Logic window for a Dropdown field, with options including is, is not, is one of, is not one of, is selected and is not selected

A few of these are worth knowing in plain terms:

  • is one of and is not one of exist only for Dropdown and Multiple Choice fields. They match any, or none, of the values you pick.
  • is greater than, is less than, their “or equal to” versions and is between exist only for Number fields. They compare numbers.
  • matches RegEx pattern and does not match RegEx pattern test an answer against a regular expression.

The wording in the editor’s dropdown may differ slightly from these descriptions, so check the list you see for the field you are using.

Operators in Emails, Confirmations, Integrations and Webhooks

Notification emails, confirmations, integrations and webhooks all use one shared list of 13 operators: is, is not, is greater than, is greater than or equal to, is less than, is less than or equal to, starts with, ends with, contains, does not contain, is one of, is not one of, and Regex. The “or equal to” operators are part of that shared list for all four, not only for emails and integrations. Each context is covered in the guide linked for it in the section on where conditional logic works.

Advanced: AND vs OR Conditions

A single condition handles many forms. When you need more, you can combine conditions.

AND: Every Condition Must Be True

With AND, a field appears only when all of your conditions are met. In the Configure Conditional Logic window, click the And button beside a rule to add another condition to the same group.

SureForms’ documentation gives this example. Show a Phone Number field only when the visitor selects Credit Card as the payment method and India as the country. If either condition is not met, the field stays hidden.

OR: Any Condition Can Be True

With OR, a field appears when at least one condition is met. Click OR Group to start an alternative group of conditions.

Using the same example, showing Phone Number when the payment method is Credit Card or the country is India means the field appears if either is true.

Combining AND and OR

You can use both together. The documentation’s example shows a “100% Off Coupon Applied” message when a visitor either enters a specific coupon code, or selects both Credit Card as the payment method and India as the country. To remove an AND condition, click the trash icon next to it.

Any and All in Emails, Confirmations, Integrations and Webhooks

Outside field rules, conditions work a little differently. Notification emails, integrations and webhooks use Add Trigger Conditions, and you choose a matching mode: Any (at least one condition must be met) or All (every condition must be met).

Conditional Confirmations default to All. The button that adds another condition reads And in All mode and Add in Any mode. You will use these when routing emails, data and confirmations in the use cases below.

8 Real Conditional Logic Use Cases

Each use case notes where the rule is set up, so you can find it quickly.

1. Ask a Follow-Up Question Only When It Applies

Show Years of Experience only when Do You Have Prior Experience? is Yes. A visitor who answers No is never asked how many years they have. Set up on: the field’s Advanced tab, Show rule.

2. Hide a Field Once the Answer Makes It Unnecessary

Hide Please Specify when How Did You Hear About This Job? is LinkedIn, Job Board or Referral, using “is one of.” The field stays relevant only for Other. Set up on: the field’s Advanced tab, Hide rule.

3. Collect Business Details Only From Business Accounts

Add a choice between Business Account and Personal Account. Show the business detail fields only when Business Account is selected, and they stay hidden for Personal Account. This is the example SureForms’ documentation uses to explain the feature. Set up on: each business field’s Advanced tab, Show rule.

4. Show the Payment Block Only for Paid Options

Add a choice such as Choose Your Plan, with a free option and one or more paid options. Show the Payment block only when a paid option is selected, so visitors who pick the free option never see a payment step.

Card details are collected by the Payment block itself, never by ordinary form fields. Connect Stripe first, as SureForms’ payment form guide describes, then choose the payment type, the amount and the payment methods in the block’s settings. The block offers Stripe, and PayPal with SureForms Premium. When more than one method is enabled, visitors choose between them inside the block. Never ask for card numbers or security codes in regular text or number fields. Set up on: the Payment block’s Advanced tab, Show rule.

5. Keep the Submit Button Hidden Until Terms Are Accepted

Add a Multiple Choice or Checkbox field for accepting terms, then add a Custom Button and show it only when the visitor selects Accept. The button stays hidden until the condition is met, and a hidden button also blocks submission. Set up on: the Custom Button’s Advanced tab, Conditional Logic, Configure Conditions, the same way as any field.

Three things to know about this one. You can add only one custom button per form. The Custom Button block is free, but conditional logic on it needs SureForms Premium, version 2.12.0 or later. And Custom Buttons do not function in the conversational layout, which is covered below.

6. Show a Different Confirmation Message or Redirect

Show one success message to one group of visitors and a different message, or a redirect to another page, to everyone else. For redirects you can also pass form data to the next page using query parameters, which is useful for tracking or for showing personalized content on the page they land on. Set up on: Form Settings, Conditional Confirmations, Add New.

7. Send Notification Emails Only When Conditions Are Met

Turn on Add Trigger Conditions for a notification so the email is sent only for the submissions that matter. For example, add a separate notification for each team and give each one its own condition, such as sending the sales notification only when a Department dropdown is set to Sales. Set up on: Form Settings, Email Notification, edit the notification, Add Trigger Conditions.

8. Send Leads to Your CRM or a Webhook Only When They Qualify

Use conditions to keep unqualified submissions out of your tools. SureForms’ documentation gives two examples. For integrations, it describes sending data to HubSpot only for leads that meet conditions such as Lead Status equals Hot Lead and Budget is greater than 50000. For webhooks, it describes triggering a webhook only if the user’s age exceeds 18. Set up on: Form Settings, Integrations, Add Trigger Conditions. For webhooks, add the Webhooks integration and use its Add Trigger Conditions setting.

Conditional Logic vs. Conversational Forms: Which to Use?

Conditional logic and conversational forms solve different problems, and it helps to know what each one does before choosing.

What Conversational Forms Do

A conversational form presents one question at a time instead of the whole form at once. In SureForms you turn it on from the Instant Form panel with the Conversational Layout toggle, or you can generate one with the AI form builder. Conversational Forms are also a Premium feature. See SureForms’ conversational forms guide for the full setup.

Using Them Together

Field-level conditional logic works in the conversational layout, so you can show or hide questions based on earlier answers there too.

The layout skips four blocks: Page Break, Custom Button, Separator and Register. Because Custom Button is one of them, the hidden submit button technique from use case 5 does not work in the conversational layout. Page Break is skipped because the layout already shows one question at a time.

How to Choose

Use conditional logic on a standard form when you want visitors to see the whole form, when you need rules that go beyond fields, such as emails, confirmations and integrations, or when you want to control the submit button. Use a conversational form when a one-question-at-a-time experience suits the audience better than a full form. Either way, test every answer path on the front end before you publish.

Troubleshooting Conditional Logic

If a rule is not behaving as expected, work through these checks in order.

Your Rules Are Not Taking Effect

Click Set Rules in the Configure Conditional Logic window, then save the form in the editor. SureForms’ guide has you do both. Then view the form again on the front end.

You Cannot Find the Setting

Conditional logic is part of SureForms Premium. Without Premium, the Conditional Logic panel still appears on a field’s Advanced tab, but it is locked, with a Premium badge and a disabled toggle. If you see that, check that the Premium plugin is installed and licensed on the site you are working on.

If the panel is missing entirely, open Settings, then Manage Features (added in SureForms 2.14.0) and confirm that the feature has not been switched off. Then select the field, open the Block tab, click the Advanced tab and look for the Conditional Logic section.

You Renamed a Field’s Slug

Each field has an internal slug. Field show and hide rules do not use it, so renaming a slug does not break them. Rules that match fields by slug can break: the conditions on notification emails, confirmations, integrations and webhooks.

SureForms’ slug guide says that changing a slug after a form is in use can cause issues, and to manually update every place the old slug was used. If one of those rules stopped working after a rename, restore the original slug or update the rule.

A Field Is Missing From the Entry

This is expected behavior. Values of fields hidden by conditional logic are not saved in the entry, and a required field that is hidden by conditional logic does not block the form from being submitted.

The Submit Button Rule Does Not Work

Check four things. The rule is set on a Custom Button, not the default submit button. SureForms Premium is active and on version 2.12.0 or later. The form has only one Custom Button. And the form is not using the conversational layout, where Custom Buttons do not function.

You Are Not on the Latest Version

Several conditional logic problems have been fixed in updates, so keep SureForms current. Examples from the release notes:

  • 2.5.1: In the free plugin, a payment block amount now updates with conditional logic. In Premium, conditional logic now works when multiple values are selected in a Multiple Choice field.
  • 2.5.2: Conditional logic now applies when a form is embedded in an Elementor popup (Premium).
  • 2.7.1: Field labels in non-Latin characters could generate unstable slugs that broke conditional confirmation logic. This was fixed.
  • 2.11.0: Configured conditions were silently dropped when a form re-rendered. This was fixed.
  • 2.12.0: Custom Buttons gained conditional logic (Premium).
  • 2.13.0: Conditional emails, post feeds and field restrictions could ignore AND/OR rules, and webhooks could fire when their AND/OR conditions were not met. Both now follow the conditions you set.

If your site uses a caching or script-optimization plugin and something still looks wrong after updating, see SureForms’ guide on setting up SureForms with caching plugins.

Conclusion

Conditional logic turns a one-size-fits-all form into one that responds to each visitor. In SureForms that goes well beyond showing and hiding fields: you can control the submit button, notification emails, confirmation messages, integrations, webhooks and post feeds with the same idea.

The setup is quick. Select a field, open its Advanced tab, switch on Conditional Logic, choose Show or Hide, click Configure Conditions, set your rule, click Set Rules and save. Start with one simple rule, test every answer path on the front end, and add complexity only when a form needs it.

Conditional logic is included in every SureForms Premium plan, with a 14-day money-back guarantee.

Get SureForms Premium

If you want to see conditional logic in action first, you can try SureForms on a demo site with no setup, or compare the free and paid versions in SureForms Free vs Pro.

FAQ

Leave a Comment

Your email address will not be published. Required fields are marked *

Start Creating Beautiful Forms Easily with SureForms Today

Start with AI-generated forms and customize them to your needs.
SureForms makes form creation a breeze.

Trusted by Thousands of Businesses
Start for Free. No Credit Card Required
24/7 World Class Support Team
Scroll to Top