Display Text Confirmation Before Redirecting in Gravity Forms

Dec 20, 2021

3 Min. Read

Share URL

This page may contain affiliate links. Please read my disclaimer for more information.

Symptoms

Out-of-the-box Gravity Forms does not support using two confirmations at the same time when a form is submitted.

However, because we were recently asked how to show a confirmation message before redirecting the user to another URL, we decided to put together a couple of options.

How To Fix It

There are (at least) three different ways of accomplishing this.

  1. You can use the gform_confirmation filter to output a confirmation message and then perform a redirect (code snippet below).
  2. Add custom JavaScript to the text confirmation (code snippet below).
  3. Use a third-party redirect plugin.

1. The gform_confirmation filter:

Copy and paste the code snippet below into your themes functions.php file or use a functionality plugin like WPCodeBox (recommended).

Once the code is added you will need to make three modifications:

  1. On line 31 add your form ID number(s), replacing 5, 16, 43 with your form ID(s).
  2. Edit the confirmation message on line 40, change it to whatever you’d like, or leave it as is.
  3. On line 42 set the number of seconds you’d like to delay the redirect. The snippet is currently configured for a two second delay, 2000 = 2 seconds.
https://gist.github.com/chrisegg/6757433e3020e68328da220b50d7615d

Configure the Redirect Confirmation

For this snippet to work, your form’s default confirmation must be set to redirect and configured with the desired URL.

  1. Go to the form Settings
  2. Click Confirmations
  3. Click to edit the Default Confirmation
  4. Click Redirect
  5. Enter your URL
  6. Click Save Confirmation

2. Custom JavaScript text confirmation

This option requires that the default confirmation be configured to use the Text type and the snippet below be added to the editor text tab.

  1. Go to the form Settings
  2. Click Confirmations
  3. Edit the Default Confirmation
  4. Make sure Text is selected
  5. Click on the Text tab
  1. Copy and Paste the snippet below into the editor
  2. Make any changes you’d like to the message
  3. Set your desired number of seconds to delay the redirect (i.e 2000 = 2 seconds)
  4. Check to Disable auto-formatting
  5. Click Save Confirmation
https://gist.github.com/chrisegg/1618874380d71285d685e1a73cde53cd

Redirect plugin

You will need to install the Shortcode Redirect plugin. This is essentially the same solution as using the custom JS above, it is just a code-free method if you prefer to avoid messing with code.

  1. Go to the form Settings
  2. Click Confirmations
  3. Edit the Default Confirmation
  4. Make sure Text is selected
  5. Create your message
  6. Add the plugin shortcode to the message (below)
[redirect url='https://yoururl.com' sec='2']
  1. Add your redirect URL to the shortcode
  2. Set the number of seconds you want to delay the redirect
  3. Click Save Confirmation

Need More Help?

If you still need help, feel free to use the comments or chat options below.

If you have an active Gravity Forms license, you can also open a support ticket here.

Photo of author
About the Author
Chris Eggleston
Husband. Father of 4. Grandpa of 2. Chief Problem Solver exploring business systems, technology, AI & faith — helping people solve real problems. @mantiswp @chrisegg

Support Chris - Donate $5

Gravity Wiz Add-Ons

Advertisement

0 0 votes
Article Rating
Subscribe
Notify of
guest
17 Comments
Inline Feedbacks
View all comments
Bryan
Bryan
2 years ago

Does Option 2 still work? Getting an error message…

Bryan
Bryan
Reply to  Chris Eggleston
2 years ago

Thank you

Bryan
Bryan
Reply to  Chris Eggleston
2 years ago

All right. Thank you. Unfortunately, since I am not the SuperAdmin, I don’t have the capability of adding a plugin, but I can discuss it with him and see what he want to do.

Bryan
Bryan
Reply to  Chris Eggleston
2 years ago

I do believe so. Are you seeing it working if auto-formatting is disabled?

Bryan
Bryan
Reply to  Chris Eggleston
2 years ago

Very good. I will test it out.

Bryan
Bryan
Reply to  Bryan
2 years ago

Hmmm…

Bryan
Bryan
Reply to  Bryan
2 years ago
Bryan
Bryan
Reply to  Chris Eggleston
2 years ago

PHP 8.0.28
Gravity Forms 2.7.12

Bryan
Bryan
Reply to  Bryan
2 years ago

Figured out the issue. Script works fine. Because I am not the SuperAdmin, however, Gravity Forms would not permit me to include Javascript in the confirmation. My SuperAdmin was able to do it for me, however. Thanks for all your help with this.

Charlie
3 years ago

This is great guys. Quick question concerning the first solution…does it still work with multiple redirect confirmations setup to trigger on specific pages?

Hugatron
Hugatron
4 years ago

Thank you! After much searching, this is the first where I got clear instructions on how to accomplish. With other sites (including gravity forms) I had no idea where to place the code.

I didn’t even think about adding js to the confirmation directly, using the ‘text’ tab.

Related Post

Automatically Switch from a Registration Form to a Waitlist in Gravity Forms

This tutorial shows you how to automatically switch from a registration form to a waitlist form in Gravity Forms using entry limits or attendee tracking with a custom shortcode.

Sep 29, 2025

4 min. read

Using AI + Gravity Forms to Streamline Job Applications

Hiring is tough. Sorting through dozens, or even hundreds, of job applications is time-consuming, repetitive, and prone to human bias. That’s where combining Gravity Forms, Gravity Flow, and AI automation comes in.

Sep 26, 2025

2 min. read

Turn Gravity Forms Image Choice Field into carousel

Problem Recently, I saw a Gravity Forms user looking for a way to style the new Image Choice field. Specifically,...

Jul 14, 2025

3 min. read

Offer Subscription With One-Off Add-On Product Options with Gravity Forms

Want to offer a subscription + one-time add-ons in Gravity Forms? Here’s how to do it using Stripe’s setup fee feature in a single payment feed.

Mar 24, 2025

2 min. read

Gravity Forms A/B Split Testing

Problem We recently received an interesting request from a Gravity Forms user who wanted to know how to do A/B...

Mar 21, 2025

5 min. read

Gravity Forms Field Validation Based on Form Entries

Problem Recently a client reached out with a very specific request for a project she was working on. Simply put,...

Mar 20, 2025

3 min. read