Conditional Logic for Custom Fields
Pro. This feature requires WB Member Blog Pro. The free plugin must be installed and active first. See the Pro index for every Pro module.
Show or hide custom fields based on other field values. Conditional logic creates dynamic forms that adapt to what members are posting, showing only relevant fields.
What You’ll Learn
How conditional logic works Setting up conditions on fields Available condition operators Real-world examples
How Conditional Logic Works
Conditional logic lets you create rules like:
“Show the Event Location field ONLY when Post Type equals Event” “Show the Price field ONLY when Listing Type equals For Sale” “Hide the Recipe Video field when Video Available equals No”
The form updates in real-time as members make selections.
Setting Up Conditional Logic
Step 1: Create the Trigger Field First
The field that controls visibility must exist before the dependent field. For example, create a “Post Type” select field first.
Step 2: Create the Dependent Field
Create the field that should show/hide (like “Event Location”).
Step 3: Enable Conditional Logic
In the dependent field’s settings, scroll to Conditional Logic and toggle it on.
Step 4: Configure the Condition
Action: Choose “Show” or “Hide” Target Field: Select the field to compare Operator: Choose the comparison type Value: Enter the value to match
Step 5: Save the Field
Click Save Field. The logic is now active.
Condition Operators
OperatorMeaningUse CaseEqualsExact matchShow Location when Type = EventNot EqualsDoesn’t matchShow Info when Type ≠ HiddenContainsPartial text matchShow field if text contains “premium”Is EmptyField has no valueShow default when field is blankIs Not EmptyField has any valueShow related field once something entered
Example: Event Post Type
Create a form where event-specific fields only appear when “Event” is selected.
Fields Setup
- Post Type (Select field)
Options: Article, Event, Review No conditional logic (always visible)
- Event Date (Date field)
Conditional: Show when “Post Type” equals “Event”
- Event Location (Text field)
Conditional: Show when “Post Type” equals “Event”
- Ticket Price (Number field)
Conditional: Show when “Post Type” equals “Event”
Result
Members creating an Article see only basic fields. When they select “Event,” the date, location, and price fields appear instantly.
Example: Product Listing
Listing Status (Select field)
Options: For Sale, Sold, Not For Sale
Price (Number field)
Conditional: Show when “Listing Status” equals “For Sale”
Sold Date (Date field)
Conditional: Show when “Listing Status” equals “Sold”
Example: Review With Optional Video
Has Video (Checkbox field)
Label: “Include video review?”
Video URL (Oembed field)
Conditional: Show when “Has Video” is not empty (checked)
Multiple Conditions
You can add multiple conditions to a single field. All conditions must be true for the field to show (AND logic).
Example: Show “Premium Badge” field when:
Listing Type equals “Featured” AND Price is not empty
Tips for Conditional Logic
Keep it simple: Complex chains of conditions can confuse users Test thoroughly: Fill out the form yourself to ensure logic works Consider required fields: Hidden required fields can block submission - make them not required or always visible Document your logic: Use Help Text to explain why fields appear
Troubleshooting
IssueSolutionField not showingCheck the trigger field value matches exactlyField stuck hiddenVerify trigger field exists and has optionsCan’t submit formHidden required field - make it not required
Related Documentation
Custom Field Types Guide Creating Custom Fields Step-by-Step Displaying Custom Fields on Posts
]]>

