W3 Mind Logo
Home » Redirect page after submitting contact form 7

Redirect page after submitting contact form 7

If you want to redirect the page after the web form submission. Then you can do it easily by adding the JavaScript code in header.php Or footer.php.

				
					<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
    location = '/thank-you/';
}, false );
</script>
				
			

Also if you want a different page for a specific contact form (ID=123) after submission, then you can add the following code.

				
					<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
    if ( '590' == event.detail.contactFormId ) {
        location = '/quote-thank-you/';
    }
}, false );
</script>
				
			
About Author
Picture of W3Mind

W3Mind

W3Mind focuses on Blogging, Make Money Online, SEO, Business Blogging, Social Media, WordPress, Internet Tools, Web Design and Development.
Give it a Share
Facebook
Twitter
LinkedIn
You May Also Like
How to
START A
BLOG
(step by step)
Load WordPress Sites in as fast as 37ms!