Redirect After Form Submission

Redirects to a specific URL after successful form submission
Add this code to your footer:

JS

<script type="text/javascript">
    document.addEventListener('wpcf7mailsent', function(event) {
        if ('123' == event.detail.contactFormId) { // Replace 123 with your form ID
            location = 'https://example.com/thank-you/'; // Replace with your thank you page URL
        }
    }, false);
    </script>

Snippet Feedback

Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.

9 Views

Language

Did it work?

Save Snippet

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.