29 Oct, 2009
Contact Form 7 – Thank You Page
You are here: Home » General » Contact Form 7 – Thank You Page
The Contact Form 7 plugin for WordPress is recognised as one of the best for providing users with an enquiry form on WordPress installations. Although great at what it does, there is no standard option to redirect the user to a ‘thank you’ or ‘success’ page once the form has been submitted. The disadvantage of this is that if you are trying to monitor conversion tracking in Google Analytics (or other software) then you cannot judge how many people are sending enquiries. There is, however, a solution.
In the older versions of the plugin, you had to edit some of the source code to include a redirect rule, but it is much simpler with the latest version. The following steps show you how.
1. Log in to your WordPress dashboard, and go to the settings page for the Contact Form 7 plugin.
2. Scroll to the bottom of the page and ‘show’ the Additional Settings
3. Insert the following code:
on_sent_ok: "location.replace('http://www.website.co.uk/thank-you/');"
Obviously replacing ‘www.website.co.uk/thank-you/’ with the URL to your website thank you page.
Once you save the settings, that is all you should have to do. When a user next sends an enquiry, they will be redirected to your customised thank you page.
You will now be able to monitor conversions through Google Analytics. You also have the added advantage of providing the users with more information on the success page, which could help reduce the bounce rate, and keep visitors on the site for longer.
I don’t take any credit for finding this solution, as I eventually find out in the comments section of an article on the GrapeThinking website.
Update – the above fix no longer appears to work, particularly with WordPress 3. Please see the following post for an up-to-date fix:
Contact Form 7 – Redirect to a thank you page in WordPress 3




4 | Kieron Hughes
January 8th, 2010 at 8:52 pm
Hi Greten, thanks for the comment, and I’m glad it helped you out! :)
Cheers for stopping by.