No longer recommended
The Contact Form 7 – Success Page Redirects plugin author says that “in order to ensure that all forms are submitted, and that users are redirected to success pages from your forms, they disable Contact Form 7’s JavaScript for all forms”.
While disabling CF7’s JavaScript does not affect your forms’ ability to send messages, it does turn off a host of other useful extra functionality normally provided in Contact Form 7 including:
- Exclusive option for checkboxes
- Character count
- Preventing full post or page reload when form is submitted
- Any other JavaScript added in the Additional Settings tab
- Any other plugins that rely on Contact Form 7’s JavaScript to run.
We think turning off CF7’s JavaScript is a bit of a sledge hammer approach – it may get you a quick resolution, but you should be aware of the possibility of unintended consequences.
We now recommend Contact Form 7 Redirection which uses DOM events to perform redirection, without JavaScript being disabled, as recommended by the Contact Form 7 plugin author, Takayuki Miyoshi.
Contact Form 7 – Success Page Redirects
Redirect visitors to success pages or thank you pages
Provides a method to redirect visitors to success pages or thank you pages. If no message is sent, or if there is an error with the form, the user will not be redirected.
Most Contact Form 7 users don’t use this plugin because the Contact Form 7 Documentation includes a simple way of Contact Form 7 – Redirecting to Another URL After Submissions.
Simply insert the following line into the Additional Settings tab:
on_sent_ok: "location = 'http://example.com/';"
You just need to replace the http://example.com/ with the URL of the page you want to redirect to.
NOTES:
The Contact Form 7 – Success Page Redirects plugin author says that “in order to ensure that all forms are submitted, and that users are redirected to success pages from your forms, they disable Contact Form 7’s JavaScript for all forms”.
While disabling CF7’s JavaScript does not affect your forms’ ability to send messages, it does turn off a host of other useful extra functionality normally provided in Contact Form 7 including:
- Exclusive option for checkboxes
- Character count
- Preventing full post or page reload when form is submitted
- Any other JavaScript added in the Additional Settings tab
- Any other plugins that rely on Contact Form 7’s JavaScript to run.
If you find yourself using this plugin because you are having problems doing redirects, you may be creating other problems you don’t know about.
Turning off CF7’s JavaScript is a bit of a sledge hammer approach – it may get you a quick resolution, but you should be aware of the possibility of unintended consequences.
Rather you should use Contact Form 7 – JavaScript Conflict Problems to find if your theme or another plugin is the real cause of your problem. It’s likely to be causing other problems you may know about.
Further reading:
- Contact Form 7 – Redirecting to Another URL After Submissions
- Contact Form 7 – JavaScript Conflict Problems
- Contact Form 7 – Check JavaScript/AJAX is working
Website – Contact Form 7 – Success Page Redirects