How to Create a Conditional Logic Form in WordPress

Ever opened your inbox to find a pile of vague, half-filled enquiries mixed in with a few spam messages? You're not alone. Many site owners reach for conditional logic, where a WordPress contact form shows or hides fields based on earlier answers, hoping it will fix the mess. Diviniket WP Forms doesn't list conditional logic as a feature, so I want to be upfront about that before you build anything.

The good news is that a simple form often solves the same problem. Ask only for what you need, protect the form from bots, and keep every entry somewhere you can review it. This post walks through how to do that with the plugin, and where you'll need a different approach if branching questions are a hard requirement for you.

Build a simple contact form with the visual builder

Open the Divine Forms section in your WordPress dashboard and add a new form. The visual form builder lets you choose the fields you need and arrange them without writing any HTML or PHP. For a typical enquiry form, a Name field, an Email field and the phone input cover most cases. The phone input has a country-flag selector and adds the country code for you, which helps if some of your enquiries come from other countries.

When you save the form, the plugin gives you a shortcode. It looks like this:

[divismfo_form id="123"]

The 123 is only an example ID. Your form will have its own number, so copy the one the plugin shows you.

Keep the form short. Fewer fields means fewer vague messages, and that does more for the quality of your inbox than most clever tricks.

Style the form to fit your theme

The plugin has style controls for form width, height and alignment, plus background opacity, input text color, placeholder color and placeholder transparency. That's enough to make a form sit neatly inside a content column and match your site's colors. It isn't a full theme editor, so don't expect animations or unlimited design options.

The forms are described as responsive and mobile-ready. Even so, rendering can differ from one theme to another, so open the page on your own phone before you call it done. If you want changes beyond the style controls, adding CSS through your theme is a general WordPress technique, and it sits outside the plugin.

Cut down on spam entries

Spam is usually the first thing that makes an inbox unusable. The plugin has a built-in honeypot, a hidden trap designed to help spot automated submissions, and it works without any external CAPTCHA provider. It helps reduce automated spam, but it doesn't promise to stop every bot. You can read more about the spam protection options on the feature page.

If you want a stronger check, the plugin also supports Google reCAPTCHA v2, Cloudflare Turnstile and hCaptcha. You add the provider's credentials once in the global settings, then switch the CAPTCHA on for each form that needs it. These are third-party services, so they need setup on your side, and the response token and IP address are sent to the provider for verification when they're active. No option here guarantees zero spam, so treat them as layers that make life harder for bots.

Send entries to Google Sheets

Entries are stored in WordPress, but many people also like a spreadsheet they can filter and share. The Google Sheets integration sends submissions to a spreadsheet you configure. It needs a little setup: you create Google service-account credentials, enter them in the plugin settings, connect the spreadsheet, and validate the sheet details where the plugin supports it.

After that, you enable synchronization for the form and send a test entry to check the data lands in the right columns. Data is sent only when sync is enabled for that form and a submission is processed, so a form without sync turned on won't write to the sheet. It sends submissions out to the sheet and isn't a two-way sync, so editing a row in the spreadsheet won't change the entry in WordPress.

What happens after someone submits

The plugin has email settings for the administrator and for the person who submitted the form, including custom notification settings. That means you can hear about new enquiries and send a confirmation to the visitor where you've configured it. Email delivery depends on your hosting and mail setup, so if messages go missing, checking that setup is a general WordPress step worth doing first.

If you'd rather send people to a thank-you page, a form can be set up to redirect after submission instead of showing the default success message. Forms can also be submitted without a full page reload, which feels smoother for visitors. Caching and optimization settings differ from site to site, so test the form after any change to them.

Every submission is saved in the plugin's own database tables, and you can review entries under Divine Forms > All Entries. That's easier than digging through email, and it gives you one central place to look at what people sent.

What to know first: conditional logic and other limits

Showing or hiding fields based on earlier answers isn't something the plugin documents, so please don't plan a form around it. The same goes for multi-step forms and calculations. If your form really depends on branching questions, a different form builder, or custom JavaScript written by a developer, is the honest route. That would be a general WordPress technique and not a feature of this plugin.

A few other things are not part of the plugin: built-in payment processing, PDF generation, WhatsApp messaging and appointment scheduling. A booking enquiry form works fine for collecting requests, but it isn't a booking calendar. For most small business sites, a short form with spam protection and a reliable place to store entries is plenty.

Quick walkthrough

  1. Open the Divine Forms section in your WordPress dashboard and add a new form.
  2. Add the fields you need, such as name, email and the phone input.
  3. Adjust the form design options, like width, alignment and text colors.
  4. Choose your spam protection. The honeypot is built in, and for a CAPTCHA you add the keys in the global settings and enable it for this form.
  5. Set up email notifications, and a redirect if you want a thank-you page.
  6. Save the form and copy its shortcode.
  7. Paste the shortcode into a page or post, using a shortcode block or any area that accepts shortcodes.
  8. Submit a test entry, then check Divine Forms > All Entries and, if you've connected it, your Google Sheet.

FAQ

Can I show or hide fields based on earlier answers?

Conditional logic isn't a documented feature of the plugin, so don't build around it. If you need it, look at a different form builder or custom code written for your site.

Does it work with Elementor, Divi or the block editor?

The plugin documents shortcode-based use with the WordPress Block Editor, Elementor, Divi and Beaver Builder. That means you paste the shortcode into a suitable block or widget, rather than using a dedicated module for each builder.

Do I need a CAPTCHA?

Not necessarily. The honeypot is built in and works without an external provider. A CAPTCHA adds another layer, but it needs provider credentials and has to be enabled for each form.

Where can I find my submissions?

Entries are stored in WordPress and you can find them under Divine Forms > All Entries. The plugin's listing also shows an export option for entries.

What happens to my data if I uninstall the plugin?

There is a Delete All Data on Uninstall setting. You need to enable it before you uninstall if you want the plugin data removed, and it can't remove copies already sent to outside services such as Google Sheets.

If you'd like to see this set up on screen, there are tutorial videos on YouTube. And if you have a feature idea or a question, you can find me here: Aditya Singh on LinkedIn.

Download Diviniket WP Forms