How To Redirect to another URL after Submit Contact form 7

Today we learn how to redirect to another URL after submitting contact form 7

First of all, let me admit it to be true that this tactic I am writing about in this post is not important to 99.99% of users and in fact, I do not recommend its use. I’m writing this for 0.01% of you, so you can forget it if it’s not important anymore.
As you know, Contact Form 7 redirects to the same URL as the shape’s URL after shape submission within the default settings. However, in very unusual cases, you’ll probably want to make it optional to redirect to another URL after submission. I’ll write on this post how you can set up Contact Form 7 to do just that.
By the way, I get requests regularly through clients on how they can redirect to a so called “thank you page”. In most cases, they need to realize this because they infer that redirecting to a “thank you page” is important for monitoring size submissions with Google Analytics. It is not important at all now. In fact, it is an old and nonsense practice. Today you can do song submissions with Google Analytics without any redirection.
so you have different purpose to redirect to some other URL?
The only way is to use Contact Form 7’s custom DOM opportunity to run JavaScript. The following is an example of a script that redirects you to another URL when wpcf7mailsent occurs:

document.addEventListener( 'wpcf7mailsent', function( event ) {
  location = '';
}, false );

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *