Want to show visitors different content based on their form submission? This guide will show you how to set up WordPress conditional redirect on form submit.
Approximate read time: 4.5 minutes
You get better results and more customers by customizing what your customer sees based on their interests.
Using conditional form redirects to personalize what a customer sees after using a form is an excellent way to use this strategy.
And we’ll show you how to do it in this guide with a simple plugin on your WordPress website.
👉 Want a simple redirect after form submit?: How to Redirect After Form Submit in WordPress [3 Steps!]
What is conditional redirect on form submission?
A conditional form redirect allows you to take website visitors to different pages based on their form answers.
Whether it’s products, contact forms, or login redirects, it’s a great way to improve the user experience.
Imagine you own a bakery.
One customer chooses cakes, and another chooses donuts. You don’t want one big page for them to scan through. That doesn’t keep visitors on your site.
Instead, you redirect them.
Cake lovers get to bask in all your cake glory. And donut fanatics stare in awe at your amazing glazed donuts.
Everyone only sees what they want. And that’s important for personalization and a better user experience.
So, now you know the what and the why. It’s time to get to the how.
How to set up automatic redirect in WordPress
With Formidable Forms, you can easily create any form you want using its simple drag-and-drop form builder.
You may think you need a redirection plugin for this, but a form builder WordPress plugin can handle this easily. In addition to many form-building features, you can use its conditional form redirect feature to set up your form to redirect users where you want.
So, there are four steps to follow:
For our example, we’ll use the scenario of an online clothing store.
Step 1: Create your form
So, go to your WordPress dashboard and click Formidable → Forms to get started.
Click Add New at the top, then Blank Form to start a new form. Give it a name, then click Create
Using Formidable’s drag-and-drop builder, you can easily add any field you want to the form.
So, we’ll add a dropdown with six options:
- Baby clothing
- Boy’s clothing
- Girl’s clothing
- Men’s clothing
- Women’s clothing
- Shoes & Accessories
You can even take this a step further and add a checkbox for existing customers.
Next, add conditional logic. So, an email and password field will show if customers check the box.
Using this, you can offer your loyal customers free shipping or exclusive discounts!
We’ll leave this off for now and have customers sign in later to keep things simple.
So, feel free to customize your form to fit your business needs, then click Update to save your changes.
Step 2: Create your landing pages
Now that you’ve set up your form, you’ll need landing pages for each category.
You can design your page however you want, but you want to consider the URL slugs carefully.
This makes avoids confusion when creating your redirects. So, for our example, we’ll set up six pages for non-customers with “new-” in the URL. Returning customers will use “returning-”.
So, to make things easy with our form, our new customer URL slugs look like this:
And our returning customer URLs will look like this:
You can customize your URLs however you like, but following a similar pattern will make it much easier for you.
Step 3: Set up your form redirect settings
In our form, the ID for the dropdown selection is 56, and our returning customer box is 57.
Be sure to check what your Form ID is so you can set everything up properly.
Next, we can use these to set up our redirect easily. First, go to your form and click the Settings tab.
Under General, go to the On Submit section and set the dropdown to Redirect to URL. We’ll add part of our URL and some conditional statements in the URL field.
Ultimately, our URL will look like this:
https://mysite.com/[if 57 equals=""]new-[/if 57][if 57 equals="I am a returning customer"]returning-[/if 57][56 show="value"]
All we’re doing is setting up a custom redirect to a URL, depending on what the customer chooses.
The URL creation follows these steps:
- It’s entering the domain name
- Next, it checks if the returning customer box is ticked. If it isn’t, it adds “new-” to your URL. If it is, it adds “returning-”
- Last, it takes the value of the category the customer selected and adds it to the URL
So if a customer chooses they want to see women’s clothing and they’re a returning customer, the form will direct them to:
Pretty cool, right?
Step 4: Display your form
Now that everything is created, we just need to display it on your website so people can fill it out!
So, head to the post/page where you want to show your form. Then, add a new WordPress block, and search for Formidable. Next, select the block and choose your form from the dropdown menu.
Last, update your post/page, and your form is live!
Whether it’s a contact form submission or for products, using a redirect on your form can be a valuable strategy.
This post taught you how to create and customize your form redirects with Formidable Forms. As you saw, it’s incredibly easy to do amazing things with Formidable.
If you’re a website owner and want to learn more about WordPress forms, check out the best plugins for tracking visitors to improve customer flow!