Support » Plugins and Hacks » [Plugin: Contact Form 7] Redirect to Thank you page on submit

[Plugin: Contact Form 7] Redirect to Thank you page on submit

Viewing 15 replies - 1 through 15 (of 22 total)
  • nuovohost


    I would also want something like the above…..redirecting the form submitter to a new page saying “thank you for submitting your query.”

    Can anyone help us figure that?
    Thanks in advance.



    add this to the “additional settings” section:

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



    thank you very much for the reply.
    I’m using “contact form 7” with folioelements theme.

    Site: http://99tutorials.com/restaurant1/
    The problem is when I use the contact form (located at the top right hand, of the site) and hit the submit button, it redirects to a new page (simple page and not consistent with the current theme) with a message at the bottom saying “your message has been sent”.

    Or, like when I’m leaving any required field empty it redirects to a page (simple page) saying “the required field is empty”.

    I’m not a PHP expert or something like that, and when I looked into the “additional settings” section, I found the following code:

    function additional_setting( $name, $max = 1 ) {
    $tmp_settings = (array) explode( “\n”, $this->additional_settings );

    $count = 0;
    $values = array();

    foreach ( $tmp_settings as $setting ) {
    if ( preg_match(‘/^([a-zA-Z0-9_]+)\s*:(.*)$/’, $setting, $matches ) ) {
    if ( $matches[1] != $name )

    if ( ! $max || $count < (int) $max ) {
    $values[] = trim( $matches[2] );
    $count += 1;

    return $values;

    I’m not sure where to put the code, you mentioned.
    Also the page location,
    the contact form redirects to, is following:


    Any idea what should I do?

    Thanks in advance for your help.

    fastestmanalive! Thanks a ton buddy, your post helped me and contact form 7 redirect works perfectly fine

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

    It doesn’t work for me… or I don’t know how to do it well.
    I just have to copy-paste this line:

    on_sent_ok: "location.replace('http://www.YOURSITE.com');"

    in the text area “Aditional settings” of the admin.

    and it is supposed to redirect the confirmation message to a new page?


    Same problem…. didn’t work for me either. Any help?

    doesn’t seem to work anymore

    any ideas?

    It works for me in Mozilla Firefox but in IE it doesn’t…any suggestions?

    I tried adding this code to the “Additional Settings” and nothing happend. Did the new update to the plugin remove this capability? Honesly, I dont see why this isn’t a standard feature of this plugin.

    We use the Contact Form 7 Plugin on our site for various things, including an RSVP form for our events. At the end of all our forms, our members click submit and it takes them to a new page where they have the option to pay via PayPal. I inserted the on_sent_ok: “location.replace(‘http://www.YOURSITE.com’);” code into the additional settings section, and it works just fine in Firefox but not at all in IE for all my forms. To combat this, I changed the “Sent Successfully” box to “If this page does not redirect, please click here, with a link to my redirect page. Two of our forms work just fine, with the page redirecting in Firefox and the link to click here showing up in IE, but we’re having trouble with one of them and it’s compatibility in IE.

    When our members click on the Submit button in IE, it submits all information to us, but instead of redirecting them to selected page on our website to pay through PayPal, a new page opens and it says Not Found: Sorry you are looking for something that isn’t here. In FireFox, however, once a member clicks the submit button, it submits all the information and redirects them to the appropriate page.

    My website is http://www.rmpca.com and the problem exists under my RSVP page: http://rmpca.com/events/rsvp/

    I’ve tried all I can think of in terms of troubleshooting. I have deleted and redone my RSVP page, I have deleted and redone my form. Nothing seems to be working. In designing the website, I have often run into compatibility problems with IE, which is frustrating since most of my members use this browser.

    Any help or suggestions you have is appreciated!

    Which version are you using? i am currently using contact form7 Version 2.1

    I will like to know how to redirect to a thank you page or even better a paypal payment link


    This solution applies for the the latest version to date contact form 7 2.1

    Open “contact-form-7/scripts.js”

    and edit the lines to reflect the following..

    if (data.onSentOk)
    jQuery.each(data.onSentOk, function(i, n) { eval(n) });
    if(document.location == “http://sitename.com/donations/”){

    Work nicely for me if you need further info contact me at clivestewart@hotmail.com
    I will be happy to assist you

    Any advice for multiple forms on your website and how to redirect them to different pages?

    Some help would be great…

    If you’ve added the code

    on_sent_ok: "location.replace('http://www.YOURSITE.com');"

    to the “additional settings” area of Contact Form 7 and it’s not working, take a moment to see if your theme calls the wp_footer function in the footer.php theme file.

    Contact Form 7 loads the Javascript responsible for the redirect in the footer. If your theme doesn’t include the <?php wp_footer(); ?> line, the Javascript will never load…and the redirect won’t work.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Plugin: Contact Form 7] Redirect to Thank you page on submit’ is closed to new replies.