Conditional logic — showing field B only when field A is “Yes”, calculating a quote based on three selections, hiding an entire section for non-logged-in visitors — is what makes a WordPress form feel like an application. It is also one of the most fragile pieces of the stack. When it stops firing, the symptoms are predictable: all fields show on page load and never hide, or the right fields hide but never reappear when conditions are met. The fix path depends on whether the failure is JavaScript, field-ID drift, or page-builder interference.
What’s happening
Conditional logic runs in two places: client-side JavaScript watches field changes and toggles visibility, and server-side PHP re-runs the rules on submission so visitors cannot send hidden fields by tampering. Client-side fails when minification or deferred loading breaks the form’s conditional script. Field-ID drift fails when a field was deleted and recreated — the rule still references the old ID. Page builders (Elementor, Divi, Bricks, Beaver Builder) sometimes wrap the form in containers with CSS that overrides the plugin’s display logic.
How to verify
Open dev tools, look at the rendered form for display: none on conditional fields:
wp eval 'echo wp_scripts()->registered["gforms_conditional_logic"]->src ?? "missing";'
wp option get siteurl
tail -f wp-content/debug.log
In the browser console, type the form plugin’s JS namespace: gf_global for Gravity Forms, wpforms_settings for WPForms, fluent_forms_global_var for Fluent Forms. An undefined response means the script never loaded — the most common root cause.
The fix
- Exclude form scripts from minification: in LiteSpeed Cache, WP Rocket, or Autoptimize, add
gravityforms,wpforms,fluentform,ninjaformsto the JS exclusion list. Combined or deferred form scripts break conditional logic event binding. - Re-save the conditional rules: open each form, find each conditional logic group, and re-pick the referenced field from the dropdown. This refreshes the stored field ID against the current schema.
- Page builder interference: if the form sits inside an Elementor accordion or Divi tab, the conditional logic might fire but the parent container’s
overflow: hiddenclips the newly-visible field. Move the form out of nested containers temporarily and retest. - AJAX-vs-classic for multi-step: on multi-step forms, conditional logic across steps requires AJAX mode in most plugins. Disable AJAX, the cross-step conditions stop working.
- Server-side enforcement: even if client-side conditional logic shows a field, the server-side rule will still apply. Confirm that submissions with hidden-field data are rejected — if they save, the server-side rule is also broken and that is the more serious issue.
- Browser console errors: any JavaScript error before the form’s init runs will stop conditional logic from binding. Check the console on a clean page load and resolve every red error.
For WordPress sites where conditional logic drives quote generation, intake routing, or compliance disclosures, these forms are mission-critical and belong in our enterprise WordPress hosting scope. To audit conditional logic across your forms after a plugin update or builder migration, book a scoping call.