contact form 7 redirect after submit
Contact Form 7
First of all, I believe that this tip I’m writing on this post is not necessary for 99.99% of users and, actually, I don’t recommend using it. I’m writing this for the 0.01% of you, so you can ignore it if not necessary.
As you know, Contact Form 7 redirects to the same URL as the form’s URL after form submissions in the default settings. However, in very rare cases, you might need to change this to make it redirect to another URL after submissions. I’ll write in this post how you can set up Contact Form 7 to do just that.
By the way, I’m often asked by users that how they can redirect to so-called “Thank You Page”. In most cases, they want to know it because they assume that redirecting to “Thank You Page” is necessary for tracking form submissions with Google Analytics. That’s not necessary at all. In fact, it’s an outdated and nonsense custom. Today you can track submissions with Google Analytics without any redirection.
So you have other reason for redirecting to another URL?
The simplest way is utilizing Contact Form 7’s custom DOM event to run JavaScript. The following is an example of script that redirects you to another URL when the wpcf7mailsent event occurs:
Embed this snippet into your theme’s template file. Obviously, you need to replace the http://example.com/ in the code to the URL you want to redirect to.
Note: The method using on_sent_ok hook is no longer recommended.
Contact Form 7 redirect after submission
I’m using contact form 7 and I’m trying to redirect to another page after a successful contact form submission.
I’ve tried using Contact Form 7 – Success Page Redirects (https://nl-be.wordpress.org/plugins/contact-form-7-success-page-redirects/) but the plugin isn’t compatible with the theme and gives some errors.
Is there another way to redirect without using that plugin? I’ve found this https://contactform7.com/redirecting-to-another-url-after-submissions/ too, but I’m not able to implement it. The redirection is also only necessary for one contact form on the site, not all of them.
5 Answers 5
I’ve seen quite a few answers with the same responses. The major question comes when you have 10 forms and 10 different thank you pages and this solution won’t work.
I have a workaround for this.
Step 1: Create a hidden field in your form and add the thank you page URL in that.
Step 2: In the DOM event, get the thank you URL from the field and redirect the user.
I’m trying to do the same thing but yet no success. the on_sent_ok is about to be no longer recommended. Check this page DOM EVENTS on the end of the page you can find the code for a specific form.
What do you do if you have multiple forms on the same page? Using the current answers, this could be a problem (For example, IDs must be unique, or the redirect ID is on the page but the user submits a different form).
The code below attempts to fix these potential issues. This answer uses hidden form fields in CF7, but allows you to have a unique redirect URL for each form without having to edit your JS code every time you create a new form (just use a consistent name, such as «url_redirect» as shown in the code below):
The options of using the EventListener script didn’t work for me, but I found a super simple solution. Just add the WordPress plugin called «Redirection for Contact Form 7». (Look at screenshot below).
After installing the plugin, a new tab called «Redirect Settings» will appear when you go inside any of your created Contact Forms ( Look at the 2nd screenshot). Here you have the option of either setting one of your already existing custom pages of the project as redirection url, or setting an external url for the purpose. You also have other options like setting a delay in redirection etc.
WordPress.org
Русский
Redirection for Contact Form 7
Описание
The ultimate add-on for Contact Form 7 — redirect to any page you choose after mail sent successfully, firing scripts after submission, save submissions in database, and much more options to make Contact Form 7 poweful then ever.
NOTE: This plugin requires Contact Form 7 version 4.8 or later.
Использование
Simply go to your form settings, choose the «Redirect Settings» tab and set the page you want to be redirected to.
Features
New and Exciting
Cooperation with a world leading web accessibility solution — you can try it for free and make your website accessible to people with disabilities.
Our Extensions
Note: some features are availible only as an extension. Which means you need Redirection for Contact Form 7 Pro to unlock those features. You can get Redirection for Contact Form 7 Pro here!
Скриншоты
Установка
Installing Redirection for Contact Form 7 can be done either by searching for «Redirection for Contact Form 7» via the «Plugins > Add New» screen in your WordPress dashboard, or by using the following steps:
Часто задаваемые вопросы
Does the plugin disables Contact Form 7 Ajax?
No, it doesn’t. The plugin does not disables any of Contact Form 7 normal behavior, unlike all other plugins that do the same.
Does this plugin uses «on_sent_ok» additional setting?
No. One of the reasons we developed this plugin, is because on_send_ok is now deprecated, and is going to be abolished by the end of 2017. This plugin is the only redirect plugin for Contact Form 7 that has been updated to use DOM events to perform redirect, as Contact Form 7 developer Takayuki Miyoshi recommends.
WordPress.org
Русский
Contact Form 7 Redirect & Thank You Page
Описание
Overview
This plugin adds Contact Form 7 Redirect & Thank You Page features
Watch this short video of how the plugin works:
Each Contact Form 7 contact form has its own Redirect and Thank You Page settings.
Thank you Page Feature
When a contact form is set to use the Thank You Page and the user submits the form, it will send the Contact Form 7 email as usual, then redirect the user to the Thank You Page. This Thank You Page is not an actual «page» on your site, this means that form specific data can be shown on this page and it won’t be shown to any other users or indexed by search engines. The Pro version of this plugin allows you to show user specific data on the Thank You Page.
URL Redirect Feature
When a contact form is set to redirect to a URL and the user submits the form it will send the Contact Form 7 email as usual, then redirect the user to the URL specified.
Demos
List of Features
Support
If you have any problems, questions, or issues about this plugin then please create a support request and we will get back to you quickly.
WPPlugin LLC is based in Boulder, Colorado. You can visit WP Plugins website at wpplugin.org. Various trademarks held by their respective owners.
Скриншоты
Установка
Automatic Installation
Часто задаваемые вопросы
Does the plugin disables Contact Form 7 Ajax?
Not by default, however there is a setting which allows you to turn off Contact Form 7 Ajax if you want. This can be useful for certain situations where the form does not redirect correctly.
Does this plugin uses «on_sent_ok» additional setting?
No, on_sent_ok is not depreceated by Contact Form 7 and has been replaced by DOM events.
Перенаправление после оправки сообщения Contact form7
Приветствую вас дорогие читатели моего блока! Мне не раз поступали вопросы о возможности перенаправления после отправки сообщения на страницу благодарности, поэтому сегодня я расскажу именно об этом.
Навигация по статье:
На сегодняшний день Contact Form7 является одним из наиболее популярных, удобных и многофункциональных плагинов для создания формы обратной связи у вас на сайте. С его помощью можно делать как стандартные формы обратной связи так и формы заказа звонка, оформления заказа, сбор подписной базы и так далее.
Для чего нужно перенаправлять пользователя на страницу благодарности?
В основном такие страницы используют на посадочных страницах Landing Page. Бытует мнение что наличие таких страниц позволяет увеличить конверсию. Возможно это так, но при условии что ваша страница правильно оформлена.
Можно выделить несколько элементов, которые желательно реализовать на странице благодарности:
Можно разместить там следующий контент:
Главное чтобы информации не было слишком много и она была интересна вашему потенциальному клиенту.
Как сделать перенаправление после отправки сообщения в Contact Form 7.
Данный плагин содержит в себе достаточно большое количество настроек.
Более подробно о них я рассказывала в статье «Настройка Contact Form 7».
Сегодня же я остановлюсь только на возможности перенаправления.
Для того чтобы реализовать данную задачу в новых версиях плагина нам нужно:




