How to add a custom thank you page – Contact Form 7

Summary

Rather than the default message I wanted to create a custom thank you page. The benefits of a custom thank you page is not only does it allow you to display additional pages to the user but you can also track via Google Analytics.

Solution:

  1. Firstly you need to create a Thank You page in Wordpress. Customise as you like and maybe include links to related / featured pages. When this has been published copy the URL.

  2. In the Wordpress backend (admin) locate 'Contact' and choose your form. Once here click on 'Additional Settings'

  3. Copy the following code into the textarea. You will need to replace the URL with your custom Thank You page.

    on_sent_ok: "location.replace('http://pebbledesigns.co.uk/?page_id=162');"
  4. Once completed press 'Save'. Now for every user when they have submitted a form generated by Contact From 7 they will be forwarded to your custom Thank You page.