How To Redirect to Another URL After Submissions – Contact Form 7 WordPress Plugin

New messageContact form 7 is one of the best contact form generator plugin available for WordPress today. It is created by takayukister and the best thing is, the plugin is free for everyone who is building their site in the WordPress platform.

Sometimes, you may need to redirect users after filling up and submitting the form to achieve superb user experience on your site i.e.: Free audio, free ebook, free download etc.

To achieve this you just simply add a short Javascript hook on your form. On your form setting page, find the Additional Setting field at the bottom of the contact form management page. Simply insert the following line into it:

//Obviously, you need to change http://example.com/ to your desired URL.

on_sent_ok: "location = 'http://example.com/'"

contact-form-7-redirect-after-submission

Thats it and you are good to go.

If it doesn’t work, check if Ajax is properly working on your webite. It is a javascript hook, so it needs JavaScript to work. You will need another hack if you want to redirect it to a non Javascript environment webpage.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s