1. Description
  2. Usage
  3. Parameters
  4. Examples
  5. Placement
  6. Source Code


This filter can be used to dynamically change the confirmation message or redirect URL for a form


add_filter("gform_confirmation", "custom_confirmation", 10, 4);

You can also specify this per form by adding the form id after the hook name.

add_filter("gform_confirmation_6", "custom_confirmation", 10, 4);


  • $confirmation string, array

    The confirmation message/array to be filtered. For a simple confirmation message, set this variable to the message you would like displayed in the screen. To redirect the page to an URL, set this variable to an array in the following format:

    $confirmation = array("redirect" => "");
  • $form Form Object

    Current form.

  • $entry Entry Object

    Current entry.

  • $is_ajax bool

    Specifies if this form is configured to be submitted via AJAX


This example dynamically changes the confirmation message for form 102 and set form 101 to redirect to

add_filter("gform_confirmation", "custom_confirmation", 10, 4);
function custom_confirmation($confirmation, $form, $lead, $ajax){
    if($form["id"] == "101"){
        $confirmation = array("redirect" =>"");
    else if($form["id"] == "102"){
        $confirmation = "Thanks for contacting us. We will get in touch with you soon";
    return $confirmation;


This code should be placed in the functions.php file of your active theme.

Source Code

This filter is located in form_display.php