Web Toastie


Social Media and SEO Blog of a Search Marketing Consultant

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

Enjoyed this post? Enter your email address here to receive updates whenever a new article is published on Web Toastie:

Delivered by FeedBurner

13 Responses to "Contact Form 7 – Thank You Page"

1 | Mark Henry

December 1st, 2009 at 5:04 am

Avatar

Good one Kieron..I just checked out the code and found the result. The queries are now coming into my “Thank you page” ..Thanks for the info.

2 | Article Buster

December 20th, 2009 at 2:53 pm

Avatar

I use “Fast and safe contact form”. It works just fine for me

3 | Greten - WordPress customization

January 8th, 2010 at 6:47 pm

Avatar

Thanks Kieron, I’ve been looking for this tweak for quite sometime. Depending on the page, placing the thank you message on a small popup or on a separate page has advantages and disadvantages.

I will blog on this trick, I’ll link to this page and I have some additional notes.

4 | Kieron Hughes

January 8th, 2010 at 8:52 pm

Avatar

Hi Greten, thanks for the comment, and I’m glad it helped you out! :)

Cheers for stopping by.

5 | Greten - WordPress customization

January 9th, 2010 at 2:37 am

Avatar

Hi Kieron

On the second thought, I just found out that the code location.replace overwrites the history and thus, pressing the back button will not return the user to the contact form page.

I might need to do some research on how to prevent this. I tried replacing location.replace with location.href but it simply did not work.

6 | Kieron Hughes

January 9th, 2010 at 12:04 pm

Avatar

Hi Greten,

I wasn’t aware that it caused that issue, but it’s certainly an interesting one. Instead of finding a solution, maybe it would be better to set the Analytics tracking on the submit button, so you don’t have to have a thank you page?

7 | James Winsoar

April 15th, 2010 at 8:17 pm

Avatar

This tip is no longer working. Have you got any more ideas on how to get it to work?

8 | Region Ad

November 13th, 2010 at 4:30 pm

Avatar

Hello.
We invite you to post your free classified on http://www.RegionAd.co.uk where you can promote your services, sell your products and make yourself known to all UK.

You can add up to 3 descriptive pictures with your advert, also for free.

We would also like to propose to you a banner or link exchange between our websites.

Thank you for your time and we are expecting your answer regarding our proposal.

9 | Backlink Tips

March 19th, 2011 at 5:33 pm

Avatar

I just started reading your website – thanks for writing. I wanted to inform you that it is not showing correctly on the BlackBerry Browser (I’ve a Tour). Anyway, I’m now subscribed to the RSS feed on my PC, so thanks again!

10 | James Sims

April 20th, 2011 at 10:51 am

Avatar

Thanks for this Kieron, I’ve used this a couple of times now.

I think the problem with WP3 you mentioned has been fixed in the latest release of Contact Form 7, as it worked perfectly for me with no tweaking.

11 | Inky's T-Shirt Printing

May 3rd, 2011 at 6:15 pm

Avatar

Finally a solution to this problem! I only wish I had Googled this a year ago when I first started this website. My “thank you” page is now set up and working correctly. Thanks!

12 | bill

June 18th, 2011 at 8:17 pm

Avatar

I just started reading your website – thanks for writing.

13 | wwe wallpapers

July 4th, 2011 at 1:18 am

Avatar

I couldn’t currently have asked for a much better blog. You happen to be ever present to supply excellent suggestions, going on to the point for quick understanding of your website visitors. You’re surely a terrific specialist in this matter. Many thanks for being there visitors like me.

Comment Form



  • wwe wallpapers: Simply killing some time in between class time on Digg and I found your article . Not normally what I choose to examine, nevertheless it was completel
  • wwe wallpapers: It’s rare to get an experienced person in whom you may have some trust. In the world at present, nobody definitely cares about showing others the be
  • wwe wallpapers: It was a real contentment locating your site a short while ago. I came here right now hoping to find out new things. And I was not upset. Your ideas i

About

Web Toastie is a social media and SEO blog.

Web Toastie features articles about SEO industry news, web development and advances in social media. If you wish to contact us, you can do so through the online contact form.