I ran into an interesting problem the other day. I’m a big fan of the WordPress Plugin Contact Form 7. I’ve used it on many of the wordpress sites I’ve developed, and appreciate the plugin for its simple integration, nice admin interface, and the pretty ajax functionality.
Unfortunately, I recently discovered that the plugin does not allow you to specify custom landing page urls, or Thank You pages for the contact form. Some of you may wonder why I care about reloading the page to say thank you vs. the sleak Ajax popup confirming that your message has been delivered. The answer: Because I’m trying to measure performance of the contact form within my Google Adwords CPC account.
Important.. This solution only works if you have/want a designated landing page for all forms you are using with Contact Form 7.
Step 1: Browse to wp-content/plugins/contact-form-7
Step 2: Open the contact-form-7.js file in your favorite text editor.
Step 3: Look for the function: wpcf7ProcessJson (line 63)
Step 4: Look for the if statement: if (1 == data.mailSent) (line 90)
Step 5: Insert this line after the jquery (line 92) – location.href=”http://www.yourdomain.com/yourthankyoupage”;
Step 6: Save the file to your server, and test out the form.
Ideally, the author of this plugin will make a change in the next release that allows a custom variable (url) to be stored for each contact form. But until then.. here’s your fix !!!
For .kml files go to: http://www.fileextensionkml.net.
For .3g2 files go to: http://www.fileextension3g2.net.
For .itl files go to: http://www.fileextensionitl.org.
For .bup files go to: http://www.ifileextensionbup.com.
For .svg files go to: http://www.fileextensionsvg.net.
For .part files go to: http://www.fileextensionpart.net.
For .pdf files go to: http://www.ifileextensionpdf.com.
For .jnlp files go to: http://www.fileextensionjnlp.net.
For .ithmb files go to: http://www.fileextensionithmb.com.