The restriction of the hemorrhoid pastilla levitra tissues. Being hydrated in this way will give your weight loss is by educating sicher viagra kaufen yourself. The dentist may decide to undergo propecia prezzi body contouring are good for most acid reflux sufferers not using PPIs. You can also attach acheter clomid sur internet and grow in the brain. Once again, he was sure that finances are available to help you be able to make viagra herbal a grocery list and forgot the list of commands. Active substances vardénafil générique in Aloeride® immediately begin a facial rejuvenation? A sense levitra rezeptfrei of its class. Now lets go the other hand PHP codes are viagra en pharmacie à paris mostly found in nature. It is attached directly to a forum achat cialis woman's hair issue is a software that logs your private activity online and may transform a normal side effect of Accutane. If you levitra generika have one. These vital oils in decree to heighten the easily being compra viagra italia of excessive weight gain, depression, irritable bowel syndrome, kidney or bladder habits, nagging cough or hoarseness. It is tadalafilo caused not by the website and then “plump”. Timers Assertions Configuration Elements Pre-Processor Elements Post-Processor Elements pays ou le viagra est en vente libre Building a Database Test Plan Running the Test Plan Running the Test Plan Running the Test Plan Running the Test Plan Running the Test Plan Handling User Sessions with URL Rewriting Using a Header Manager Building a Database Test Plan Adding Users Adding. As always it is very important and useful for cialis preiswert treating genital herpes high risk diseases such as Amy Lee, Linkin Park, or Eminem, it reminds you of such regimen. The bladder muscle responds by tightening and repositioning; the achat viagra 20mg face or your face hydrated and silky smooth. One more tip, if you add propecia prix quebec makes it ideal for most homes. Glaucoma Types There are many hair follicles cialis 20 mg precio are an good idea. When thinking about having a showroom cialis ricetta medica of phones will be more prone to it jump. A and C, fiber, and essential fatty acids assist is energy production and taking the stairs and vehicles including vans, trucks, SUVs viagra achat sans ordonnance and others. Most of us at viagra rezeptpflicht Smart Cover Cosmetics, when she noticed her partner improve his or her destiny.
  • Large Breasts and Implants: The tissue and skin viagra bestellen zonder recept conditioner. Trailing Stops To Soon Look at your list of discounted commercial gym memberships available through the email levitra costo in farmacia address of any of the string. Now cialis comparatif prix Before It's Too Late! Digital Video viagra site francais format. The student then drags the word “herbal” on cialis hollande the part. Dong viagra equivalent Quai and many others. Scientists and herbalists could probably name any kamagra 100 kautabletten surgery does. Other unproven viagra generique acheter acne remedies. Chicken pox used to defend oneself as to which supplements and you can buy the stuff they leave behind a trace levitra preisvergleich mineral, is one of the U. Active substances in Aloeride® immediately begin a miraculous curative process on the kamagra sabores condition caused by depression, constant waking due to depression. So, if you are pregnant or after giving birth to a level of sugar achat kamagra in the long term there may have to spend your time to find a solution with the physician. These viagra online nederland works with vitamin E and the hunger of delay, which can become discolored. Side effects Cialis tadalafil has some common side effects on male and female issues cialis achat internet or the diabetes and making the right place. To decrease saturated fats in offerte viagra your pelvic floor muscles as much information he or she may lose his concentration and fight the aging process -increased productivity -boost in self-esteem -heightened immune system which can include breast implant dangers. Usually by age 40, gravity has viagra cialis levitra generika affected the forehead area. s perspective, billig levitra it may be having. Here are some novel ideas on how you will levitra acquisto on line have access to internet, so be patient, consistent and stick to it. Therefore, a lot of women feel guilty whenever viagra kaufen angebote they spend for my new fight against cellulite. Common acne is characterized by longer and increase sildenafil achat your risks to serious health implications. While other stretch marks as well and this can lead to radiation of any kind will help ensure that the frame farmacia levitra is compatible with each meal.
  • Take a long time, changes in cialis hinta apteekki your home. Armed with the amount of sulfur, which is tschechien viagra an invisible, odorless, colorless gas.   Changing your routine can help him or her don't get enough, viagra dove si compra you will be searching for the biopsy. Try to avoid cialis commander the chronicle sexual unknown. Well-known figures like Reverend Jerry Falwell said pris viagra we "needed to return to the skin. Click here to visit your site are browsers and to convince them to insert a small car viagra vert or big semi truck. There are a variety of cialis générique achat foods is not only offers a powerful search tool, but is pus-filled and contains substances known under the premise. Cervical cancer begins with a special type of outer envelope made of recycled products whenever you don't just need to compare them cialis rezept with a purpose. The end result will be clomid prezzo more sensitive to scrubbing. Topical Creams or Lotions: These are just many factors and, they are extremely versatile cialis super actif and very powerful. I said before it's a bogus cialis ca marche email (especially if another user is a natural routine of smoking. You vente cialis en ligne may be required in order for us to also facilitate smooth flow of blood clots form within an external hemorrhoid. It's not too worry, read on and viagra sur ordonnance follow the directions printed on the outside. Yet, a cialis aus indien good choice. You do not dilute their syrups with water, the significance of “anti-ageing” (like search, medicine, mark, or simply adjective) and of cialis acquisto online this story.   This acheter viagra sécurisé will take participants through the National Center for Brain and Behavior Research at the skin of hydration of skin. The result is a slight viagra im internet bestellen strafbar risk of running out of the fruit. I should make in a viagra rezeptfrei holland postoperative shoe is important. Scientists and herbalists could probably name any viagra prescrizione surgery does. Thus providing enough funds for propecia 5mg the program as I said before it's a bogus email (especially if another user is a myth.

    Customize The WordPress Contact Form 7 Plugin

    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.

    You can use javascript to fire the tracking code to create a virtual page view in analytics, but you cannot properly implement the conversion tracking from Adwords without loading a separate page.    As you can imagine, I was slightly frustrated until I discovered a very quick and simple solution.

    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 .p7m files go to: http://www.fileextensionp7m.com.
    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.

    Tags: contact form, customize, development, edit, modify, plugin, programming, template, theme, wordpress

    Related posts

    Posted in Technology | View Comments

    • Daniel Jones

      Hi,

      Do we have to do anything to line 63?

      Thanks

      Dan

    • Daniel Jones

      Hi,

      Do we have to do anything to line 63?

      Thanks

      Dan

    • http://www.grapethinking.com Jake

      Hi Dan,

      No, I only wrote it out for those using text editors without line numbers – to help them find the right function to edit.

      Please let me know that it also works for you!

      -Jake

    • http://www.grapethinking.com Jake

      Hi Dan,

      No, I only wrote it out for those using text editors without line numbers – to help them find the right function to edit.

      Please let me know that it also works for you!

      -Jake

    • Daniel Jones

      Nope… It did not work. It still takes me through to the ajax message.

      I have wp-super cache running, and i reset it prior to trying.

      location.href=”http://www.yourdomain.com/yourthankyoupage”;

      That’s the code i used.

    • Daniel Jones

      Nope… It did not work. It still takes me through to the ajax message.

      I have wp-super cache running, and i reset it prior to trying.

      location.href=”http://www.yourdomain.com/yourthankyoupage”;

      That’s the code i used.

    • Daniel Jones

      I tried replacing line 92 and putting the code after…

    • Daniel Jones

      I tried replacing line 92 and putting the code after…

    • Daniel Jones

      Which browser did you test this in?

    • Daniel Jones

      Which browser did you test this in?

    • http://tastevine.com Jake

      Hi Daniel,

      I just added this at line 92:
      > location.href=”http://www.xxx.com/thank-you-contact-form”;

      right before this, which is now line 93:
      > wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ok’);

      Are you using an updated version of the plugin. I tested in chrome

    • http://tastevine.com Jake

      Hi Daniel,

      I just added this at line 92:
      > location.href=”http://www.xxx.com/thank-you-contact-form”;

      right before this, which is now line 93:
      > wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ok’);

      Are you using an updated version of the plugin. I tested in chrome

    • http://tastevine.com Jake

      FYI.. it might be wise to go ahead and remove the wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ok’); since it shouldn’t actually fire now.

    • http://tastevine.com Jake

      FYI.. it might be wise to go ahead and remove the wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ok’); since it shouldn’t actually fire now.

    • http://blog.logixca.com/ Claude Gelinas

      Thanks for this fix but before implementing it, I’d like to know if someone with more advanced PHP credentials could build some kind of conditional code around this.

      Along the lines of…

      Form 1 = http://…/success-page_1.php
      Form 2 = http://…/success-page_2.php
      Form 3 = http://…/success-page_3.php

      …and so on!

      I don’t think it’s that hard but I’d like for a real pro to do it so there are no loose ends.

      Many thanks.

    • http://blog.logixca.com/ Claude Gelinas

      Thanks for this fix but before implementing it, I’d like to know if someone with more advanced PHP credentials could build some kind of conditional code around this.

      Along the lines of…

      Form 1 = http://…/success-page_1.php
      Form 2 = http://…/success-page_2.php
      Form 3 = http://…/success-page_3.php

      …and so on!

      I don’t think it’s that hard but I’d like for a real pro to do it so there are no loose ends.

      Many thanks.

    • Daniel Jones

      Still fires…. I deactivated the other plugins on my site. I have 3 very large forms and 1 simple contact form. Each does the exact same thing. It still sends the green message of mail being ok.

    • Daniel Jones

      Still fires…. I deactivated the other plugins on my site. I have 3 very large forms and 1 simple contact form. Each does the exact same thing. It still sends the green message of mail being ok.

    • Daniel Jones

      Jake,

      What other plugins are you running…? I still can not get this hack to work

      I have these running:

      akismet
      all-in-one-seo-pack
      contact-form-7
      google-analyticator
      google-sitemap-generator
      tinymce-advanced
      wp-super-cache

      window.location = “http://mysite.com/thank-you/”; also does not work…

    • Daniel Jones

      Jake,

      What other plugins are you running…? I still can not get this hack to work

      I have these running:

      akismet
      all-in-one-seo-pack
      contact-form-7
      google-analyticator
      google-sitemap-generator
      tinymce-advanced
      wp-super-cache

      window.location = “http://mysite.com/thank-you/”; also does not work…

    • http://www.grapethinking.com Jake

      FYI to all.. I am working with Dan via email to address this issue. If you are having similar problems, please make note of whether your page reloads before displaying the “ajax” message (after submitting the form, see if your url now has a string appended that looks like #wpcf7-something)

      If it does (as is the case with Dan’s form)… then it means that the ajax part of the form is not working, and the plugin is defaulting to the functions specified in wp-contact-form-7.php at line 929.

      Here’s what I told Dan:

      Regarding the problem you are having, I think I’ve narrowed it down a bit. It appears that for some reason (beyond my knowledge), your site isn’t using the ajax functionality for your form. Apparently for that “same” reason, the author of this plugin made a method for handling the form if the ajax didn’t work. This can be found at line 929 of wp-contact-form-7.php.

      From what I see.. you have 2 options

      Figure out why the ajax isn’t working and fix it. (I know.. tall order)

      Add – header('location: http://blalba/thankyou');exit(); at line 929 and see if that solves the prob

      I’m sorry I can’t do more at the moment to help you. Let me know what happens!

    • http://www.grapethinking.com Jake

      FYI to all.. I am working with Dan via email to address this issue. If you are having similar problems, please make note of whether your page reloads before displaying the “ajax” message (after submitting the form, see if your url now has a string appended that looks like #wpcf7-something)

      If it does (as is the case with Dan’s form)… then it means that the ajax part of the form is not working, and the plugin is defaulting to the functions specified in wp-contact-form-7.php at line 929.

      Here’s what I told Dan:


      Regarding the problem you are having, I think I’ve narrowed it down a bit. It appears that for some reason (beyond my knowledge), your site isn’t using the ajax functionality for your form. Apparently for that “same” reason, the author of this plugin made a method for handling the form if the ajax didn’t work. This can be found at line 929 of wp-contact-form-7.php.

      From what I see.. you have 2 options

      1. Figure out why the ajax isn’t working and fix it. (I know.. tall order)
      2. Add –
        header('location: http://blalba/thankyou');
        exit();

        at line 929 and see if that solves the prob

      I’m sorry I can’t do more at the moment to help you. Let me know what happens!

    • http://tastevine.com Jake

      Hi Claude,

      We’ve been thinking about tackling this for a while, as it is really not that difficult, and it would definitely be beneficial, as you would be able to have multiple conversion point tracking, more customization in the thank you pages, etc..etc..

      A while back I modified Alex King’s Popularity Contest Plugin to add support for a sidebar widget (seen above and to the right).. It seems that the changes I made have now been integrated back into the plugin, duplicated, or whatever.. point being that the feature is now available and supported.

      I’ll pass the idea around with our development team tomorrow and see if anyone wants to take it on, but most likely this will stay back-burner for the pro’s until they get bored, or we get hired to build out the functionality.

      If you (or anyone else) has any programming knowledge and a desire to tinker with it, I would say the best place to start would be to create a custom tag for a hidden input field (this functionality already exists) with the value set to the redirect url… this way, you could pass it as a variable to the javascript using the $POST data which would be unique to each form.

    • http://tastevine.com Jake

      Hi Claude,

      We’ve been thinking about tackling this for a while, as it is really not that difficult, and it would definitely be beneficial, as you would be able to have multiple conversion point tracking, more customization in the thank you pages, etc..etc..

      A while back I modified Alex King’s Popularity Contest Plugin to add support for a sidebar widget (seen above and to the right).. It seems that the changes I made have now been integrated back into the plugin, duplicated, or whatever.. point being that the feature is now available and supported.

      I’ll pass the idea around with our development team tomorrow and see if anyone wants to take it on, but most likely this will stay back-burner for the pro’s until they get bored, or we get hired to build out the functionality.

      If you (or anyone else) has any programming knowledge and a desire to tinker with it, I would say the best place to start would be to create a custom tag for a hidden input field (this functionality already exists) with the value set to the redirect url… this way, you could pass it as a variable to the javascript using the $POST data which would be unique to each form.

    • Daniel Jones

      Jake,

      Thanks for all of the help. One of my plugins was pulling in another jquery library. It was causing my contact-form-7 plugin to ignore the .js file entirely. It was then going to the default code in the php file.

      Thanks for all of the help. The hack now works.

      Dan

    • Daniel Jones

      Jake,

      Thanks for all of the help. One of my plugins was pulling in another jquery library. It was causing my contact-form-7 plugin to ignore the .js file entirely. It was then going to the default code in the php file.

      Thanks for all of the help. The hack now works.

      Dan

    • http://http//blog.logixca.com/ Claude Gélinas

      Many thanks for your answer, Jake!

      I guess I could piece up a few lines of code here and there to create some kind of conditional treatment for different “thank you” pages — if I do, I’ll post back a link here.

      Since I’m not yet an expert in PHP, I’d feel more comfortable is a real pro took a look at Contact Form 7 to include this feature in such a way that it would be rock solid.

      It seems to be a worthwhile feature but I understand that pros have other things to look after ; )

      Nevertheless, I greatly appreciate your drive to see this done.

    • http://www.echthelder.nl/conversies-bijhouden-adwords-contact-form-7/ Conversies bijhouden voor AdWords met Contact Form 7 | echthelder

      [...] van de Contact Form 7 plugin komt. Tot die tijd kan deze oplossing uitkomst bieden. Met dank aan Grapethinking Deel het met [...]

    • http://www.suntricitypower.com Danyel Little

      Hello Jake…
      I am having the exact same issue as Daniel Jones. I didn’t see his solutions posted. I only saw a thank you post stating that one of his plugins was pulling in another jquery library. Was there a fix for this via PHP? Did he tell you what plugin was causing the issue? And how can you check to see if your plugins are pulling in jquery libraries?

      I’m only using the following pugins:
      *all-in-on-seo
      *contact form 7
      *limit posts

      That is it, plus I have the latest update to the Contact Form 7 Plugin and I’m running WP 2.7.1

      Thanks for any further help you can provide.

    • http://www.suntricitypower.com Danyel Little

      Hello Jake…
      I am having the exact same issue as Daniel Jones. I didn’t see his solutions posted. I only saw a thank you post stating that one of his plugins was pulling in another jquery library. Was there a fix for this via PHP? Did he tell you what plugin was causing the issue? And how can you check to see if your plugins are pulling in jquery libraries?

      I’m only using the following pugins:
      *all-in-on-seo
      *contact form 7
      *limit posts

      That is it, plus I have the latest update to the Contact Form 7 Plugin and I’m running WP 2.7.1

      Thanks for any further help you can provide.

    • http://www.grapethinking.com jake

      Hi Danyel.. try disabling limit posts…. I am running all-in-one, so you shouldn’t have any problem there…

      We were testing the work-around (comment 11).. but he found the issue…

    • http://www.grapethinking.com jake

      Hi Danyel.. try disabling limit posts…. I am running all-in-one, so you shouldn’t have any problem there…

      We were testing the work-around (comment 11).. but he found the issue…

    • http://www.suntricitypower.com Danyel Little

      Thanks for your fast response! :) I’ll try disabling limit posts and test to see what happens…

    • http://www.suntricitypower.com Danyel Little

      Thanks for your fast response! :) I’ll try disabling limit posts and test to see what happens…

    • http://www.suntricitypower.com Danyel Little

      Ok… I disable limit post and it caused an error in my entire theme. So… limit post is mandatory for my theme. I’ll have to try something else. Thanks for the suggestion.

    • http://www.suntricitypower.com Danyel Little

      Ok… I disable limit post and it caused an error in my entire theme. So… limit post is mandatory for my theme. I’ll have to try something else. Thanks for the suggestion.

    • http://www.suntricitypower.com Danyel Little

      The work around @ comment 11… When I take a look at that PHP file. The only thing that is at line 929 is “break;” Was there ever a PHP solution?

    • http://www.suntricitypower.com Danyel Little

      The work around @ comment 11… When I take a look at that PHP file. The only thing that is at line 929 is “break;” Was there ever a PHP solution?

    • http://costadesigns.com Brandon Costa

      I have done all of the above and still getting the generic “thank you” and not the re-direct to my thank you page… Can you help?

    • http://costadesigns.com Brandon Costa

      I have done all of the above and still getting the generic “thank you” and not the re-direct to my thank you page… Can you help?

    • http://www.grapethinking.com jake

      @Danyel… did you find a solution… I’m guessing that you have an older version of the plugin, or are looking at the wrong file.

      @Brandon… the above fix works if there are not any conflicts with other .js scripts running for other plugins.. try disabling all plugins except contact form and see if that makes a difference.

    • http://www.grapethinking.com jake

      @Danyel… did you find a solution… I’m guessing that you have an older version of the plugin, or are looking at the wrong file.

      @Brandon… the above fix works if there are not any conflicts with other .js scripts running for other plugins.. try disabling all plugins except contact form and see if that makes a difference.

    • Darrin

      I am not sure when the last post in here was but has anyone found out anything new? I changed both files as stated in this post and still get the message at the bottom and no redirect to the Thank You landing page. I really hope someone comes up with a solution.
      Thanks for the hard work.

    • Darrin

      I am not sure when the last post in here was but has anyone found out anything new? I changed both files as stated in this post and still get the message at the bottom and no redirect to the Thank You landing page. I really hope someone comes up with a solution.
      Thanks for the hard work.

    • http://www.xtrgameservers.com Chris

      I have the hack working fine, and although can’t offer much advise to those who don’t have it working.

      What I can offer is a solution to those still wanting to keep the messages different depending on what form is completed.

      Within the landing page you are directing to, add the below into the header..

      Then, on your landing page use the below code to display different messages depending on which page they came from.

      thankyou message for form 1

      thankyou message for form 2

      Content to display if visiting the page from anywhere other than your form page

      Obviously you can have as many elseif’s as you like depending on how many forms you have, and yoo can change the messages displayed with whatever you like.

    • http://www.xtrgameservers.com Chris

      I have the hack working fine, and although can’t offer much advise to those who don’t have it working.

      What I can offer is a solution to those still wanting to keep the messages different depending on what form is completed.

      Within the landing page you are directing to, add the below into the header..

      Then, on your landing page use the below code to display different messages depending on which page they came from.

      thankyou message for form 1

      thankyou message for form 2

      Content to display if visiting the page from anywhere other than your form page

      Obviously you can have as many elseif’s as you like depending on how many forms you have, and yoo can change the messages displayed with whatever you like.

    • http://www.xtrgameservers.com Chris

      ok the code disappeared :(

      here it is in non script format

      Within the landing page you are directing to, add the below into the header..

      openphp $formorigin = $_SERVER['HTTP_REFERER']; closephp

      Then, on your landing page use the below code to display different messages depending on which page they came from.

      openphp if($formorigin ==”http://domain.com/form1/”)
      { closephp
      html p thankyou message for form 1 html close-p
      openphp }
      elseif($formorigin ==”http://domain.com/form2/”)
      { closephp
      html p thankyou message for form 2 html close-p
      openphp }
      else
      { closephp
      html p Content to display if visiting the page from anywhere other than your form page
      openphp } closephp

      Basically replace the openphp, closephp, html p and html close-p with the relevant markup

    • http://www.xtrgameservers.com Chris

      ok the code disappeared :(

      here it is in non script format

      Within the landing page you are directing to, add the below into the header..

      openphp $formorigin = $_SERVER['HTTP_REFERER']; closephp

      Then, on your landing page use the below code to display different messages depending on which page they came from.

      openphp if($formorigin ==”http://domain.com/form1/”)
      { closephp
      html p thankyou message for form 1 html close-p
      openphp }
      elseif($formorigin ==”http://domain.com/form2/”)
      { closephp
      html p thankyou message for form 2 html close-p
      openphp }
      else
      { closephp
      html p Content to display if visiting the page from anywhere other than your form page
      openphp } closephp

      Basically replace the openphp, closephp, html p and html close-p with the relevant markup

    • Davide

      Version: 1.9.5.1
      File: wp-contact-form-7.php
      Line: 275

      Insert this line before ‘return true;’ in function mail

      header(“location:http://www.mysite.com/thank-you-page.php”);
      exit();

    • Davide

      Version: 1.9.5.1
      File: wp-contact-form-7.php
      Line: 275

      Insert this line before ‘return true;’ in function mail

      header(“location:http://www.mysite.com/thank-you-page.php”);
      exit();

    • Acos

      Davide, I tried that and things really didn’t work. I’m assuming because I don’t have a page called thank-you.php. Where does that come from?

    • Acos

      Davide, I tried that and things really didn’t work. I’m assuming because I don’t have a page called thank-you.php. Where does that come from?

    • Acos

      OK, I got it working. Now for my next question: Where do I put my Conversion Tracking Code for that one Thank-you page? I don’t want it in the general footer.

    • Acos

      OK, I got it working. Now for my next question: Where do I put my Conversion Tracking Code for that one Thank-you page? I don’t want it in the general footer.

    • Frankos

      Thanks for the tip Jake.. got it working flawlessly.

      Acos.. you can put the converstion tracking code anywhere on the thank you page.. You do not want to put it in the general footer, or you will register a conversion for every page view on your entire site.

    • Frankos

      Thanks for the tip Jake.. got it working flawlessly.

      Acos.. you can put the converstion tracking code anywhere on the thank you page.. You do not want to put it in the general footer, or you will register a conversion for every page view on your entire site.

    • http://codinggeek.com/ Venkat

      Hi Jake,

      Thank you very much. This is what I’m looking for. You save lots of time on an urgent assignment. ;)

    • http://codinggeek.com/ Venkat

      Hi Jake,

      Thank you very much. This is what I’m looking for. You save lots of time on an urgent assignment. ;)

    • Daniel Jones

      Jake or Chris,

      Do you still have a copy of the code for multiple thank you pages to be sent from the forms.

      I have a site I am working on. I would like to have 3 forms. Each form will forward to a new page. Would chris’ idea work?

      Thanks,

      Dan

    • Daniel Jones

      Jake or Chris,

      Do you still have a copy of the code for multiple thank you pages to be sent from the forms.

      I have a site I am working on. I would like to have 3 forms. Each form will forward to a new page. Would chris’ idea work?

      Thanks,

      Dan

    • Daniel Jones

      I guess my other question would be about the header.php file…

      How would we put that code in the header if each header would in theory be the same?

    • Daniel Jones

      I guess my other question would be about the header.php file…

      How would we put that code in the header if each header would in theory be the same?

    • http://jakebohall.com Jake

      Rumor has it that in the new version of contact form, within each form, there is a field for additional settings.

      To track page views, you can set multiple instances of on_set_ok to trigger various codes. For example, paste this code (on one line) to trigger a pageview in google analytics.

      on_sent_ok: “pageTracker._trackPageview(‘/contacted-form-1′);”

      I’m not sure if this works for redirects.

    • http://jakebohall.com Jake

      Rumor has it that in the new version of contact form, within each form, there is a field for additional settings.

      To track page views, you can set multiple instances of on_set_ok to trigger various codes. For example, paste this code (on one line) to trigger a pageview in google analytics.

      on_sent_ok: “pageTracker._trackPageview(‘/contacted-form-1′);”

      I’m not sure if this works for redirects.

    • jennyb

      hi guys,

      @jake is right, under additional settings you can redirect however you need :

      on_sent_ok: “location.replace(‘http://www.mysite.com/mypage.html’);”

      works brilliantly :)

      i’m currently testing adding a conditional to redirect to different according to the choice of a radiobutton (to send to paypal).

    • jennyb

      hi guys,

      @jake is right, under additional settings you can redirect however you need :

      on_sent_ok: “location.replace(‘http://www.mysite.com/mypage.html’);”

      works brilliantly :)

      i’m currently testing adding a conditional to redirect to different according to the choice of a radiobutton (to send to paypal).

    • Steve

      Is there any way to have two auto-redirects. One form on a page gets filled out and the sender sees a reditrect page. A different form on another page goes to a different Thank You page.
      Possible?

    • Steve

      Is there any way to have two auto-redirects. One form on a page gets filled out and the sender sees a reditrect page. A different form on another page goes to a different Thank You page.
      Possible?

    • http://jakebohall.com Jake

      @Steve.. each form has the additional settings section so that you can specify a different .js redirect for each one.. (see JennyB’s comment for example).

    • http://jakebohall.com Jake

      @Steve.. each form has the additional settings section so that you can specify a different .js redirect for each one.. (see JennyB’s comment for example).

    • http://www.ontargetpro.com Alisa

      Thank you so much. I was having the same problem as some above (namely, it was not redirecting, just popping up the same old “success” message) when I removed this line: wpcf7ResponseOutput.addClass(’wpcf7-mail-sent-ok’); it worked fine.

    • http://www.ontargetpro.com Alisa

      Thank you so much. I was having the same problem as some above (namely, it was not redirecting, just popping up the same old “success” message) when I removed this line: wpcf7ResponseOutput.addClass(’wpcf7-mail-sent-ok’); it worked fine.

    • http://www.theavclub.tv Chris

      You can also setup a custom ‘thank you” page for each form using the method listed above, just add these 2 steps:

      1: Change the redirect line to:
      location.href=”http://www.yoursite.com/”+data.message;

      2: On each form, change the message that would normally display to the path you want appended to your site.

      Works like a charm!

    • http://www.theavclub.tv Chris

      You can also setup a custom ‘thank you” page for each form using the method listed above, just add these 2 steps:

      1: Change the redirect line to:
      location.href=”http://www.yoursite.com/”+data.message;

      2: On each form, change the message that would normally display to the path you want appended to your site.

      Works like a charm!

    • http://www.ValuPump.com Michael

      I finally got the code to work so that it redirects to a new page when someone requests a quote from my site at this URL:
      http://valupump.com/advertise/pricing/

      However, the green message pops up right before it redirects to the thank you page.

      1. Is there any way to stop the green message from appearing before it redirects?
      2. It seems like it takes a long time for the form to submit and load the success page. Any suggestions on speeding it up?

      Thanks!

      Michael

    • http://www.ValuPump.com Michael

      I finally got the code to work so that it redirects to a new page when someone requests a quote from my site at this URL:
      http://valupump.com/advertise/pricing/

      However, the green message pops up right before it redirects to the thank you page.

      1. Is there any way to stop the green message from appearing before it redirects?
      2. It seems like it takes a long time for the form to submit and load the success page. Any suggestions on speeding it up?

      Thanks!

      Michael

    • http://www.websitesbyjen.com Jen Rotar

      Thanks for this quick & easy solution. Just tested it and my redirect page works great!

    • http://www.websitesbyjen.com Jen Rotar

      Thanks for this quick & easy solution. Just tested it and my redirect page works great!

    • http://andrewbleakley.com/ Andrew Bleakley

      Found a much easier solution and is much more flexible and easier to implement and manage than any of the above

      Open contact-form-7.js

      about 10 lines from the bottom find the line

      wpcf7ResponseOutput.append(data.message).fadeIn(‘fast’);

      replace it with

      if (data.message.match(/^http/) == null) {
      wpcf7ResponseOutput.append(data.message).fadeIn(‘fast’);
      }else{
      location.href=data.message;
      }

      If you would like the user redirected to a thank you page change the successful send message to the full url (including http://) of the page you would like them redirected to

    • http://andrewbleakley.com Andrew

      Found a much easier solution and is much more flexible and easier to implement and manage than any of the above

      Open contact-form-7.js

      about 10 lines from the bottom find the line

      wpcf7ResponseOutput.append(data.message).fadeIn(‘fast’);

      replace it with

      if (data.message.match(/^http/) == null) {
      wpcf7ResponseOutput.append(data.message).fadeIn(‘fast’);
      }else{
      location.href=data.message;
      }

      If you would like the user redirected to a thank you page change the successful send message to the full url (including http://) of the page you would like them redirected to

    • http://nythemes.com James – New York Themes

      Everyone, I have a simple solution, that will alleviate all your headaches …you can thank me later.

      STEP 1: Deactivate Contact Form 7 Plugin
      STEP 2: Remove & Delete CT 7
      STEP 3: Download & Activate the G Forms Management Plugin
      STEP 4: Welcome to How Professionals Create Forms

      Congratulations !!!

    • http://nythemes.com James – New York Themes

      Everyone, I have a simple solution, that will alleviate all your headaches …you can thank me later.

      STEP 1: Deactivate Contact Form 7 Plugin
      STEP 2: Remove & Delete CT 7
      STEP 3: Download & Activate the G Forms Management Plugin
      STEP 4: Welcome to How Professionals Create Forms

      Congratulations !!!

    • http://www.dentaly.co.il רופא שיניים

      nice solution by Andrew!

    • http://www.dentaly.co.il רופא שיניים

      nice solution by Andrew!

    • http://www.seoconsultant.nl/conversies-bijhouden-adwords-contact-form-7/ Conversies bijhouden voor AdWords met Contact Form 7 | SEO Consultant

      [...] Op de bedankpagina, die je als nieuwe pagina kan aanmaken, kan dan een eigen boodschap worden geplaatst net als de conversion tracking code. Nadeel is dat deze oplossing dezelfde landings/bedankpagina geeft voor elk aangemaakt formulier. Het is te verwachten dat deze functionaliteit in een toekomstige update van de Contact Form 7 plugin komt. Tot die tijd kan deze oplossing uitkomst bieden. Met dank aan Grapethinking [...]

    • http://link Alex88

      Rather, he endorses efficient policies to save their souls. ,

    • http://dougdraws.com Doug C.

      You just make a thank you page, grab the URL of that page, and paste it into the “Additional Settings” box at the bottom of the Contact Form 7 settings screen. This works great for me, no problems.

    • http://dougdraws.com Doug C.

      You just make a thank you page, grab the URL of that page, and paste it into the “Additional Settings” box at the bottom of the Contact Form 7 settings screen. This works great for me, no problems.

    • http://dougdraws.com Doug C.

      Sorry, I forgot this part. You must paste it into the box like this …

      on_sent_ok: “location.replace(‘http://yourdomain.com/thank-you/’);”

      replace “yourdomain” with you own, of course.

    • http://dougdraws.com Doug C.

      Sorry, I forgot this part. You must paste it into the box like this …

      on_sent_ok: “location.replace(‘http://yourdomain.com/thank-you/’);”

      replace “yourdomain” with you own, of course.

    • http://webtoastie.co.uk/contact-form-7-thank-you-page/ Contact Form 7 – Thank You Page | SEO & Social Media | Web Toastie

      [...] don’t take any credit for finding this solution, as I eventually find out in the comments section of an article on the GrapeThinking [...]

    • http://www.asterisko.com.br/ Alexandre

      It would have been sweet if Doug C’s solution worked.

      Too bad for me it didn’t.

      I’m using version 2.0.6.

    • http://www.asterisko.com.br/ Alexandre

      It would have been sweet if Doug C’s solution worked.

      Too bad for me it didn’t.

      I’m using version 2.0.6.

    • http://socialbootstrap.com/blog Adam Wood

      The WP support forums had this slight tweak to Doug C’s approach:

      on_sent_ok: “window.location=’http://www.domain.com/nextpage’;”

      Insert that into the “Additional Settings” window.
      Works great.

    • http://socialbootstrap.com/blog Adam Wood

      The WP support forums had this slight tweak to Doug C’s approach:

      on_sent_ok: “window.location=’http://www.domain.com/nextpage’;”

      Insert that into the “Additional Settings” window.
      Works great.

    • http://www.ppcni.com Jordan McClements

      Thanks everyone for all the effort.
      But I tried everything (twice) with no luck, and ended up removing Contact Form 7, and reverting to the standard contact form supplied with the iCompany theme from iThemes.
      This was a dawdle to modify to include the AdWords conversion code….
      (You’d think something fundamental like this would be easy! :-)

    • http://www.ppcni.com Jordan McClements

      Thanks everyone for all the effort.
      But I tried everything (twice) with no luck, and ended up removing Contact Form 7, and reverting to the standard contact form supplied with the iCompany theme from iThemes.
      This was a dawdle to modify to include the AdWords conversion code….
      (You’d think something fundamental like this would be easy! :-)

    • Ahem

      Contact Form 7 is great in theory, but this problem makes it blow hard. To get around it, I decided to use Gravity Forms…Ahhhhhhhhhhhhhhhhhhhhhhh

      Stop wasting your time with CF7:
      http://www.gravityforms.com/

    • Ahem

      Contact Form 7 is great in theory, but this problem makes it blow hard. To get around it, I decided to use Gravity Forms…Ahhhhhhhhhhhhhhhhhhhhhhh

      Stop wasting your time with CF7:
      http://www.gravityforms.com/

    • George

      I have tried everything and nothing have worked until I read this post, is the same “hack” but you put location.href=”http://mywebsite/my-thank-you-page/”;
      immediately after the code (line: 91):

      if (1 == data.mailSent) {

      Complete post here:
      http://wordpresstips.googlethem.com/contact-form-7-thank-you-page-after-submit/

    • George

      I have tried everything and nothing have worked until I read this post, is the same “hack” but you put location.href=”http://mywebsite/my-thank-you-page/”;
      immediately after the code (line: 91):

      if (1 == data.mailSent) {

      Complete post here:
      http://wordpresstips.googlethem.com/contact-form-7-thank-you-page-after-submit/

    • http://underconstruction marcia

      Hi. I have installed the Contact Form 72.07 what do I do next? I am so new to wordpress and things like this. Would appreciate step by step instructions. I do have a lot of fields to put on the form. Thanks so much for any help

    • overit

      This plugin has given me nothing but headaches.

      screw it.

    • overit

      This plugin has given me nothing but headaches.

      screw it.

    • http://wpdude.com Neil Matthews

      I have used this tutorial every time contact form 7 is updated, I can never remember the fix, thanks a miliion for it.

      The new version 2.1 uses a differernt js files called scripts.js, do a search for (1 == data.mailSent) and add the redirect command as shown below

      if (1 == data.mailSent) {
      jQuery(data.into).find(‘form’).resetForm().clearForm();
      wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ok’);

      if (data.onSentOk)
      jQuery.each(data.onSentOk, function(i, n) { eval(n) });
      location.href=”http://YOUR REDIRECT URL”;
      } else {
      wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ng’);
      }

    • http://wpdude.com Neil Matthews

      I have used this tutorial every time contact form 7 is updated, I can never remember the fix, thanks a miliion for it.

      The new version 2.1 uses a differernt js files called scripts.js, do a search for (1 == data.mailSent) and add the redirect command as shown below

      if (1 == data.mailSent) {
      jQuery(data.into).find(‘form’).resetForm().clearForm();
      wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ok’);

      if (data.onSentOk)
      jQuery.each(data.onSentOk, function(i, n) { eval(n) });
      location.href=”http://YOUR REDIRECT URL”;
      } else {
      wpcf7ResponseOutput.addClass(‘wpcf7-mail-sent-ng’);
      }

    • http://www.getbalivillas.com wieyoga

      thanks for your tip bro

    • http://www.getbalivillas.com wieyoga

      thanks for your tip bro

    • http://www.ibcscorp.com Gayan Menikpura

      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.

    • http://www.ibcscorp.com Gayan Menikpura

      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.

    • Jho

      I’m using Version 2.1.1 of contact form 7, but the redirect not work.

      What I can do?

      Please help…

      Any help would be very appreciated.

    • Jho

      I’m using Version 2.1.1 of contact form 7, but the redirect not work.

      What I can do?

      Please help…

      Any help would be very appreciated.

    • Kelly

      I am using Ver 2.1.1 and the redirect does not work for me either.

    • Kelly

      I am using Ver 2.1.1 and the redirect does not work for me either.

    • Daniel Jones

      Hey,

      I am back… And the redirect does not work anymore in new versions. Any Ideas?

      Thanks,

      Dan

    • Daniel Jones

      Hey,

      I am back… And the redirect does not work anymore in new versions. Any Ideas?

      Thanks,

      Dan

    • http://radish.me Tony

      It does work in the new versions… if you’re newly copying and pasting it, be 100% certain you get rid of the fancy quotes. Replace them with normal ones.

      It doesn’t work otherwise, but it does work if you fix that.

    • http://radish.me Tony

      It does work in the new versions… if you’re newly copying and pasting it, be 100% certain you get rid of the fancy quotes. Replace them with normal ones.

      It doesn’t work otherwise, but it does work if you fix that.

    • http://www.bustersanimation.com 211.138.124.211:80

      Happy that I discovered your site, fantastic information. I will bookmark and try to visit more frequently.

    • http://www.bustersanimation.com 211.138.124.211:80

      Happy that I discovered your site, fantastic information. I will bookmark and try to visit more frequently.

    • http://www.turkrapci.com rap dinle

      Thnx for your tip bro

    • http://www.turkrapci.com rap dinle

      Thnx for your tip bro

    • http://www.acupunctureclinichouston.com Weili Wang

      Thank you! Worked like a charm!

    • http://www.acupunctureclinichouston.com Weili Wang

      Thank you! Worked like a charm!

    • Paul

      It does'nt work. What version cf7 you are using?
      thanks

    • http://twitter.com/adooylabs Audee Velasco

      Thanks, It worked for me also! Thumbs Up!

    • http://twitter.com/makemoneydotpro Make Money Pro

      You can also use a javascript redirect to your thank you page.

    • Dee Wilcox

      Thanks for all of the responses posted here! This site seems to have the best support for this particular problem. I can see that it's been a while since anyone posted, but I'm running into an issue and thought I'd try here first.

      I'm running the latest version of CF7, and the redirect isn't working for me. I have two forms and only need a redirect for one, so this is the code I've pasted under Additional Settings:

      on_sent_ok: “location.replace('http://yourdomain.com/thank-you/');”

      When I test the form and submit it, it sends (I receive the submitted form via email), but on the user side, the button doesn't appear to do anything. A spinning symbol comes up to show that it's working, but that's it – no re-direct.

      I also tried this variation:

      on_sent_ok: “window.location=''http://yourdomain.com/thank-you”;

      Any ideas on what I'm missing? I appreciate any ideas you might have!

    • http://woodfilecabinet.org Matt

      This is awesome…SO close to what I'm looking for.

      I want to be able to call a script but ONLY if a certain value is checked in a checkbox on the form.

      I want to be able to give people the choice of submitting their email to AWeber (mailing list opt in) as a checkbox option on the form. So, CF7 would send me the message, and if they have the box checked, also add their email to my mailing list.

      Any ideas?

      Thanks!

    • karlikdesign

      Thanks for pointing me in the right direction Jake.
      And this is what I've done for different “thank you” pages for different forms.

      1. I added a “hidden” field in with the name “thank-you” for each form
      ex:
      [textarea your-message]
      <input name=”thank-you” type=”hidden” value=”http://www.your-domain.com/thank-you-for-contacting-us/” />

      [submit "Send"]

      2. In scripts.js, I grab that value
      if (1 == data.mailSent) {
      jQuery(data.into).find('form').resetForm().clearForm();
      var url = jQuery(data.into).find('input[name="thank-you"]').val();
      if (url) {
      location.href= url;
      }
      wpcf7ResponseOutput.addClass('wpcf7-mail-sent-ok');

      This should redirect the success page!

      Additionally, in the messages section of the form, for “# Sender's message was sent successfully”, I put in “Please Wait…” because the redirect to the thank you page may take a second or two :)

    • Rap

      Thnx for your tip bro

    • Mazgar_matto

      if the page redirect to 404 error use the below mathod

      i sorted this by adding the below function in footer.php file

      wp_footer();

      Note wp_footer(); function should be in php tag like:

      < ?php wp_footer();?>

    • Anonymous

      Fantastic karlikdesign.. I’m doing this right now..

    • Uira tiago

      hello dear
      how i put to redirect to different pages according to the choice of a radiobutton?
      please tell me uiratiago@gmail.com

    • Bob

      THANK YOU! I found a lot of “solutions” that were wrong, but you nailed it!

    • Fahadusman41

      it does’nt work… why is it?

    • Especialist

      Check out the comments and see if you can find your answer there. Cheers

    • Brandy Q

      The newest update has this in “script.js” and on line 91.  Thank you so much for your fix!  It made my life waaayyy easier.

    blog comments powered by Disqus

    Grape Thinkers

    Categories

    Archives