Skip to content

Instantly share code, notes, and snippets.

Created June 14, 2022 16:22
What would you like to do?
Contact Form 7 Submission Redirect
add_action( 'wp_footer', 'mycustom_wp_footer' );
function mycustom_wp_footer() {
$site_url = get_site_url();
document.addEventListener( 'wpcf7mailsent', function( event ) {
location = '<?php echo $site_url; ?>/landing-thank-you/';
}, false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment