The wpforms_frontend_form_action filter is used to alter the default form action on submission of the form.


(array) Action to be taken on form submit.
(array) Processed form settings/data, prepared to be used later.



More Information

The filter can be used to alter the default action of the form.


In this example for form ID 999, we’re modifying the form action URL. Remember to update the form ID to match your form ID.

 * Alter default action of form submission.
 * @link
 * @param   array  $action     Returning action to be taken on form submit.
 * @param   array  $form_data  Form data.
 * @return  array

function wpf_custom_form_action( $action, $form_data ) {

// Check if the form ID matches the form where you want to modify the action.
    if ( $form_id === 999 ) { // Replace 999 with your form ID.

        // Modify the form action URL as needed.
        $form_action = '';
    return $form_action;

add_filter( 'wpforms_frontend_form_action', 'wpf_custom_form_action', 10, 2 );

Please note, if you are going to use this filter for redirect, your entry will not be saved into the WPForms entries and AJAX will need to be disabled in order for the redirect to take place.

Reference Articles

How to Customize the Form Action