Divi’s Contact Form and Email Optin can send visitors to another page after a successful send, but always in the same browser tab, so the visitor leaves your page. With Open the redirect in a new tab on, the redirect page opens in a new tab instead, while the form page stays where it is and shows Divi’s success message.
Switch it on
- Go to Divi Doctor → Features.
- Under Contact Form module, find the Open the redirect in a new tab card and click Enable. The same card covers the Email Optin module.
Divi 5 Contact Form and Email Optin modules now have an Open In A New Tab switch next to Divi’s redirect options. It’s off on every form until you switch it on there.
Contact Form
- Open the page in the Visual Builder and open the Contact Form’s settings.
- In Content → Redirect, switch on Enable Redirect URL and enter the Redirect URL.
- Switch on Open In A New Tab, right below.
- Save the page, and clear any page cache.
The form page shows the text from Content → Text → Success Message, or Divi’s “Thanks for contacting us” if it’s empty. To style it, see Success message design.
Email Optin
- Open the Email Optin module’s settings.
- In Content → Success Action, set Action to Redirect to a custom URL. and enter the Redirect URL.
- Switch on Open In A New Tab, below Divi’s options.
- Save the page, and clear any page cache.
The query arguments you tick in Divi’s Redirect URL Query (name, last name, email, IP address, CSS ID) are added to the address in the new tab, as Divi adds them. The form page shows Divi’s success message, “Success!” unless you wrote your own Message. Divi shows that field while Action is set to Display a message., so set your message first, then switch the action to the redirect.
What visitors see
- The visitor fills in the form and sends it. If Divi finds a problem in the browser, such as an empty required field, nothing opens and Divi shows its error as usual.
- When the form is valid, a new tab opens straight away and shows Loading… while Divi sends the form.
- When Divi reports success, the new tab shows your redirect page, and the form page shows the success message.
- If Divi reports an error instead, for example because the email couldn’t be sent or the email service refused the signup, the new tab closes and the form page shows Divi’s error.
An empty tab never stays behind. It closes if there’s no answer after 30 seconds, and when the visitor leaves the form page before the answer arrives. If a success comes in after the empty tab was closed, the redirect page still opens, in a new tab or, if the browser blocks that, in the same tab.
Pop-up blockers
Browsers only allow a new tab right after a click or key press. That’s why the tab opens the moment the visitor sends the form, before Divi has answered, and only gets the redirect page once Divi reports success.
- If the browser blocks the new tab anyway, the redirect page opens in the same tab, exactly as Divi does without this option.
- With Content → Spam Protection → Use A Spam Protection Service on, Divi first waits for the spam protection token, so the tab opens a moment later, when Divi starts sending. Safari may block it then, and the page opens in the same tab.
How it works
For each form with Open In A New Tab on, Divi Doctor hides the redirect address from Divi’s own script, so Divi shows its success message instead of leaving the page. A small deferred script (about 4 KB), loaded only on pages with such a form, opens the empty tab during the visitor’s click and sends it to the redirect page once Divi’s request has succeeded. Divi’s checks, spam protection and sending are unchanged.
- Only
httpandhttpsaddresses are opened. - The redirect page can’t control or reach back to the form page.
Check that it works
- Switch on Open In A New Tab for a form with a redirect URL, save, and clear any page cache.
- Open the page in a private window and send the form.
- A new tab opens with the redirect page, and the form page shows the success message.
Try the browsers your visitors use, especially Safari if the form uses a spam protection service. The card in Divi Doctor → Features shows whether the feature is on and whether Divi 5’s modules were found.
Limits
- Divi 5 Contact Form and Email Optin modules only.
- The switch shows only while the form has a redirect: Enable Redirect URL on the Contact Form, Action set to the redirect on the Email Optin.
- A browser that blocks the new tab gets Divi’s same-tab redirect.
- A page served from a full-page cache built before you switched the option on keeps Divi’s same-tab redirect until you clear the cache.
- Turning the feature off, or deactivating Divi Doctor, brings back Divi’s same-tab redirect. Clear any page cache so visitors get the change. The switch stays saved in your forms.
Questions
How do I make the Divi Contact Form redirect open in a new tab?
Switch on Open the redirect in a new tab in Divi Doctor → Features, under Contact Form module. Then, in the form’s Content → Redirect, switch on Enable Redirect URL, enter the Redirect URL and switch on Open In A New Tab. Save the page and clear any page cache. The redirect page then opens in a new tab, and the form page stays put and shows Divi’s success message.
Can the Divi 5 Email Optin redirect open in a new tab?
Yes. The same Open the redirect in a new tab card covers the Email Optin module. In Content → Success Action, set Action to Redirect to a custom URL., enter the Redirect URL and switch on Open In A New Tab. The query arguments you tick in Redirect URL Query are added to the address in the new tab, as Divi adds them.
Will pop-up blockers stop the Divi form redirect from opening a new tab?
Divi Doctor works around them. Browsers only allow a new tab right after a click or key press, so the tab opens the moment the visitor sends the form and gets the redirect page once Divi reports success. If the browser blocks it anyway, the redirect page opens in the same tab, as Divi does without this option. With a spam protection service on, Safari may block the tab.
What happens if a Divi form fails to send after the new tab opens?
The new tab closes and the form page shows Divi’s error, for example when the email couldn’t be sent or the email service refused the signup. An empty tab never stays behind: it also closes if there’s no answer after 30 seconds, and when the visitor leaves the form page before the answer arrives.
Why don’t I see the Open In A New Tab switch in my Divi form?
The switch shows only while the form has a redirect: Enable Redirect URL on the Contact Form, or Action set to the redirect on the Email Optin. It also needs Open the redirect in a new tab switched on in Divi Doctor → Features, because Divi Doctor’s features are off by default. It works with Divi 5 Contact Form and Email Optin modules only.
More options for the Contact Form: Contact Form error messages and CC, BCC, routing and the sending page.