Contact Form 7 Redirect Multiple Forms To Different Pages After Submission Without A Plugin

Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist: wplearninglab.com/17-point-wp...
Contact Form 7 Redirect Multiple Forms To Different Pages After Submission Without A Plugin • Contact Form 7 Redirec...
Code on blog: wplearninglab.com/contact-for...
Contact form 7 redirect after submit will let you send people to any page you like after they have successfully completed and submitted your form. Even better news is that you don't need to use a plugin, just copy the code from the blog and put it where I show you in the video.
Stop brute force attacks before they happen with this workshop: wplearninglab.com/brute-force...
Grab your free 17-Point WordPress Pre-Launch PDF Checklist: vid.io/xqRL
Download your exclusive 10-Point WP Security Checklist: bit.ly/10point-wordpress-harde...
I hope this information helps you! If you have any questions leave a comment below or ping me @WPLearningLab on Twitter.
--------------
If you want more excellent WordPress information check out our website where we post WordPress tutorials daily.
wplearninglab.com/
Connect with us:
WP Learning Lab Channel: kzread.info_c...
Facebook: / wplearninglab
Twitter: / wplearninglab
Google Plus: google.com/+Wplearninglab
Pinterest: / wplearninglab

Пікірлер: 149

  • @AliBellinchouse
    @AliBellinchouse3 жыл бұрын

    Hi, just went to the blog page for this and I cant get the code as the page doesn't seem to load correctly. Could you post the code into the area above? Thanks

  • @roclaroc
    @roclaroc4 жыл бұрын

    Thanks - Your videos are simple and easy to follow. Been using them a lot lately. Much appreciated.

  • @wplearninglab

    @wplearninglab

    4 жыл бұрын

    Thanks Gary and thanks for watching!

  • @antoineclinton7772
    @antoineclinton77723 жыл бұрын

    Ha...you answered my question I posted on your other tutorial vid. Awesome...Thanks for this. Subscribing!

  • @AnrideBeer
    @AnrideBeer Жыл бұрын

    Hi Bjorn. Thank you. Your blog post is a bit funky. The layout is all narrow and strange. I ended up retyping your code, works like a charm. You're a legend. thank you.

  • @wplearninglab

    @wplearninglab

    Жыл бұрын

    Hi Anri, Thanks for letting me know about the funky blog post. It definitely isn't intended to be that way. I'll look into it! And I'm happy the code worked for you!

  • @j.ameliacaceres1804
    @j.ameliacaceres18045 жыл бұрын

    Great tutorial! Thanks so much.

  • @mohamedaflal4565
    @mohamedaflal45653 жыл бұрын

    Thank you very much! very helpful and clear instruction!

  • @wplearninglab

    @wplearninglab

    3 жыл бұрын

    You’re welcome Mohamed, thanks for watching!

  • @lucacolognese1405
    @lucacolognese14056 жыл бұрын

    Hello Bjorn, thanks for the tip. I added your code to my function.php file and redirect is working good. However the tiny loading gif that appears next to the Submit button is no more being displayed as well as the the feedback message at the bottom. Do you think it can be related to the snippet injection?

  • @kishwarjabeen5980
    @kishwarjabeen59804 жыл бұрын

    appreciative :) this video helps me a lot

  • @pablogermano5634
    @pablogermano56343 жыл бұрын

    Thanks! You helped me a lot.

  • @wplearninglab

    @wplearninglab

    3 жыл бұрын

    You’re welcome Pablo, I’m happy I could help. Thanks for watching!

  • @PerryWebCreations
    @PerryWebCreations6 жыл бұрын

    nice and easy to follow, thanks!

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    You're welcome Blaine. Thanks for watching!

  • @tiagorossi7254
    @tiagorossi72544 жыл бұрын

    Very good. Thanks!

  • @rohitrajani999
    @rohitrajani9996 жыл бұрын

    Great video, thanks much!

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    You're welcome Rohit, thanks for watching!

  • @charlesdwight6096
    @charlesdwight60966 жыл бұрын

    Who is this guy? This is AWESOME! I was searching for a few days on how to make the submit button in Contact Form 7 take me to another page when I came across this video. Thank you soooo much !!!!

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    You're welcome Charles, I'm glad I could help. Thanks for watching!

  • @topm4t-playmatspersonaliza106
    @topm4t-playmatspersonaliza1064 жыл бұрын

    thank you very much my friend helped me a lot

  • @JohnnyPageMusic
    @JohnnyPageMusic6 жыл бұрын

    Great video - thanks for your help :)

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    You're welcome Johnny, thanks for watching!

  • @ashkanahmadi
    @ashkanahmadi4 жыл бұрын

    excellent video. thank you so much

  • @JaredIsham
    @JaredIsham2 жыл бұрын

    What if you wanted to redirect to different pages based on the answers provided. Would that be a matter of using the field ID instead of the form id? Or maybe this is doable in Elementor Pro?

  • @oswaldolagla5990
    @oswaldolagla59905 жыл бұрын

    I have been finding this perfect tutorial for weeks THANK YOU! we had to many troubles with plugins and my Facebook pixel just doesn’t works fine now with dirección I hope my metrics shows better on my web site thank you. Hi from Ecuador

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    You're welcome Oswald, I'm glad I could help. Thanks for watching! Hi from Canada :)

  • @nageshmadastu3070

    @nageshmadastu3070

    5 жыл бұрын

    @@wplearninglab Hi I have added the code to the functions.php and I have 4 forms but only 1 out of 4 forms is redirecting others are not redirecting can you please help in fixing the same. I am not getting what went wrong. Thanks

  • @5958637
    @59586376 жыл бұрын

    Thank you, good job!

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Thanks and thanks for watching!

  • @manny3095
    @manny30954 жыл бұрын

    anyways that you can have multiple redirect pages for one type of form that redirects users based on their ansewers?

  • @alejandromendez4109
    @alejandromendez41095 жыл бұрын

    Thank you for the helpful video, but I have one issue. I'm getting a unexpected '?' error. Any tips on resolving it?

  • @barrydonoghue6008
    @barrydonoghue60086 жыл бұрын

    Great Video M8, Just as an additional point. I have always used the method of going to the "Additional setting" tab in any of your contact form 7 forms. You can add in "on_sent_ok: "location = '/thank-you/';". This will also redirect the visitor to a "thank you" page or any page you select after the visitor successfully submits the form. If people are not comfortable with changing files this is or was an easier way. But this method might have changed recently with an update or something. Also, with adding code or changing code in a functions.php file using the WordPress editor, there is always the chance of making a simple syntax error and crashing the site.

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi Barry, that's a great tip, but unfortunately the on_sent_ok method has been deprecated by the plugin developer and was scheduled to stop working at the end of 2017 according to this page on their site: contactform7.com/2017/06/07/on-sent-ok-is-deprecated/ You're right about the dangers of the functions.php file, but that is one of the only ways toake this work in the future. Unless the developer adds an on_sent_ok alternative in the future.

  • @barrydonoghue6008

    @barrydonoghue6008

    6 жыл бұрын

    Interesting post, looks like I have some checking to do on my older sites, cheers for the Info. Keep up the great work.

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Thanks Barry, I plan to keep it up :)

  • @AlejandroLopez-rg7bi
    @AlejandroLopez-rg7bi4 жыл бұрын

    How can we do it selecting the submit id? Because i have several submits in my form and i need a event for each one

  • @tejasnareshsuvarna7948
    @tejasnareshsuvarna79486 жыл бұрын

    Great video sir. Thank you so so much. I owe you sir. Really great job :)

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    You're welcome Tejas, thanks for watching!

  • @lauramoscarella7889
    @lauramoscarella78895 жыл бұрын

    Thanks. Very helpful.

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    You're welcome Laura, thanks for watching!

  • @profesorEnji
    @profesorEnji6 жыл бұрын

    best as always!

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Thanks Aleksandra and thanks for watching!

  • @revelation333
    @revelation3335 жыл бұрын

    I have a for with paypal option and cash pay option. After filling up the form and submit to PayPal it goes direct to paypal but when submit is set to redirect to PayPal the second submit on the sqme for which is for cash payment also redorects to paypal or vice versa. Can you please let me know, how to send second button for cash and thank you page and PayPal to submit and then redirect.

  • @TheAntonico
    @TheAntonico5 жыл бұрын

    Hi. Excellent your videos. Is it possible to do this with an Elementor form? Thank you!

  • @federicomazza9130
    @federicomazza91302 жыл бұрын

    Great tutorial, many thanks!! but is it possible to have a single CF7 form with two different action if I check one of another checkbox? I would like to have one single form with two different payment method: one via PayPal (that works perfectly using the Contact Form 7 - PayPal & Stripe Add-on ) and another via bank transfer that redirect to another page with the bank information (but even sending the CF7 input)? Huge thanks!

  • @Adzdigitais
    @Adzdigitais3 жыл бұрын

    How I do this considering the choice of Dropdown menu?

  • @franciscosautomotive
    @franciscosautomotive5 жыл бұрын

    can you do this with Ninja forms plugins?

  • @kleberkibe
    @kleberkibe6 жыл бұрын

    Thank you , very much

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    You're welcome and thanks for watching!

  • @jslima1976
    @jslima19763 жыл бұрын

    Hi tks for your video. I have a questions. Is there a possibility to check the content of my field for exempla I will write ABC or DFG and then I will open the correct page for each content of my field Name. tks again

  • @antoineclinton7772
    @antoineclinton77723 жыл бұрын

    Hi, the code on your blog doesn't look to contain all the code as indicated in your video.

  • @-30h-work-week
    @-30h-work-week4 жыл бұрын

    Is it possible to have the form redirect to a page depending on what the user selected in the form? :-) Say I have 3 select boxes with 3 options each. So there are 27 possible combinations. Can I have 27 "thank-you" pages, or whatever-pages that the form redirects to depending on what the user selected in the form?

  • @mohamedaflal4565
    @mohamedaflal45653 жыл бұрын

    I cannot find the right code on your blog page. seems like something missing there. could you please paste the code here?

  • @RogerSands-Lianne
    @RogerSands-Lianne3 жыл бұрын

    The code seems to be missing from the blog. Could you post it here? Thanks

  • @rafaeln8784
    @rafaeln87845 жыл бұрын

    I cant copy the code in the website.

  • @padma_shinde
    @padma_shinde2 жыл бұрын

    how can I attach different PDF to different forms that can be downloaded after form submit and then re-direct to thank you page?

  • @smartexpress7731
    @smartexpress77314 жыл бұрын

    help me - syntax error, unexpected '?'

  • @kanchanapisutchutikulanant2908
    @kanchanapisutchutikulanant29082 жыл бұрын

    Many thanks to your video, This really useful to me. Can I ask another question? Is it possible to redirect to different pages when I check on each different checkbox?

  • @schlepers
    @schlepers2 жыл бұрын

    Thanks!!!

  • @wplearninglab

    @wplearninglab

    2 жыл бұрын

    No problem, thanks for watching!

  • @mariepatena104
    @mariepatena1044 жыл бұрын

    Thank you sir for the very helpful video, I have a question, is it possible to have 2 redirection url in 1 form? Like a conditional logic? Example: a thank you page and a sorry page?? Please adivise. Thank you

  • @rishabhgroup
    @rishabhgroup5 жыл бұрын

    Very nice tutorial. I have used the same in one of my websites and it is working perfectly fine but when I'm doing the same, just by adding the script in function.php my website faces error 500. I don't know what went wrong? Please help!

  • @shoaibabdulkhaliq.
    @shoaibabdulkhaliq.3 жыл бұрын

    Code Working

  • @jassinfotech2961
    @jassinfotech29613 жыл бұрын

    contact form 7 redirect after submitting another page particular form in contact form 7 ?

  • @khalhariri
    @khalhariri3 жыл бұрын

    please i dont find the code in the page

  • @jmshuk
    @jmshuk4 жыл бұрын

    Hi - a very straightforward video (thanks!) but a couple of issues. My functions.php file ends with ?> If I paste your code after the end of the file (after the "?>", per your video), I get this error message: "syntax error, unexpected '}', expecting end of file" Is that too many, or not enough "}" characters? Is it something else? In trying to troubleshoot this, I've noticed that the script code in your video is different from the script code on your blog - in the video the code ends with

  • @wplearninglab

    @wplearninglab

    4 жыл бұрын

    Hi Julian, Most functions.php files don't end with ?> because that file does need to close its' PHP block. So if you delete the ?> from the end of the functions.php file and then paste in the code I created it should work. Or you can leave ?> and paste my code BEFORE it, so that the file still ends with ?> I hope that helps :) Let me know if you have any further questions. Thanks for watching!

  • @goczbela8469
    @goczbela84696 жыл бұрын

    thx!

  • @lucmaradan4370
    @lucmaradan43705 жыл бұрын

    THANK YOU !

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    You're welcome Luc, thanks for watching! Let me know if you have any questions :)

  • @lucmaradan4370

    @lucmaradan4370

    5 жыл бұрын

    WordPress Tutorials - WPLearningLab do you think there are issues to set up this tip with the theme Divi ? I did it today and it don’t seems to work. Another point : I could not copy the code on your blog. The page is blocked for sélection...

  • @neetasanas7894
    @neetasanas78946 жыл бұрын

    Great. Thank you so much. I want to open url in new tab. what can i do for this?

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi Neeta, to open URLs in a new tab you have to add target="_blank" to the href tag. Something like: Anchor Text I hope that helps and thanks for watching!

  • @neetasanas7894

    @neetasanas7894

    6 жыл бұрын

    Thank you very much for reply. This is not worked for me. plz suggest any other option for this

  • @GinaAnagnostopoulou
    @GinaAnagnostopoulou4 жыл бұрын

    Simple and excellent tutorial. One problem though, I have a child theme and when I add the code just before the php closing ?> in here (child theme functions.php): the entire site crashes. Any idea why?

  • @wplearninglab

    @wplearninglab

    4 жыл бұрын

    Hi Gina, Without seeing the actual file, I can only make educated guesses. In that file, make sure you only have one at the end of the file. You can only leave that out in the functions.php file. Let me know if those help.

  • @anirudhvktakkar
    @anirudhvktakkar3 жыл бұрын

    Elementor has thankfully taken away this headache for me. Great tutorial nonetheless. It's better to know how to do it yourself than rely solely on a page builder.

  • @with_zach
    @with_zach2 жыл бұрын

    full code is missing on the blog post. Currently only has: add_action( 'wp_footer', 'cf7_thank_you_redirect' ); function cf7_thank_you_redirect() { ?>

  • @Sallyross6
    @Sallyross63 жыл бұрын

    Where is the code? The blog link sends me back to the page with the video. I'm going around in circles!

  • @kristinabressler2098
    @kristinabressler20985 жыл бұрын

    I have problem with the code. Since I wanted the form to open a new tab after submission, I replaced location with window.open(url, _blank); It works fine in desktop on Firefox and Chrome after I disable popup blockers for those web site. However, It wouldn't work in mobile on my iphone 6. How do I fix that?

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    Hi Kristina, Have you disabled the popup blockers on your iPhone? If you had to do that for desktop, it may be the same for your phone. I hope that helps :) Let me know if you have any further questions. Thanks for watching!

  • @ChrisAtFiverr

    @ChrisAtFiverr

    5 жыл бұрын

    @@wplearninglab that doesn't work for me no matter if I use Safari, Chrome or Firefox. what else could it be that doesn't allow the redirect page to appear?

  • @devsingh5286
    @devsingh52866 жыл бұрын

    I pasted the script in functions.php from where the code ended and saved it. not sure it saved or not but i was kicked out of the backend and when i tried to login i get http error 500 on chrome, firefox shows blank page (both after clearing cache). Website works fine. When i try to submit the main contact us form i got busy 2 arrows going in loop in circles next to the submit button. For submitting the second form that page is blank (other pages on website are visible and accessed). I am using Renovate - Construction Renovation WordPress Theme by QuanticaLabs EDIT: The code didn't got saved as i can see via cPanel file manager but weirdly after trying to put the code i cannot access backend, and contact pages show busy sign after submission. Other than that whole website is online. What I have tried so far to fix wp-admin / Dashboard so i can see login screen: 1 Renamed .htaccess file but didn't fix the problem and still cant see dashboard login screen. 2 Changed the PHP storage limit to 264MB in wp-config.php. It still didn't fix the problem 2 Renamed the plugin folder and checked to see if that has fixed the problem didn't fix it and get error 500 for whole website (Website offline) so changed it back to get website online Any suggestions on this?

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Could it be that you deleted other code in the functions.php file by accident? Is there white space (carriage returns) at the bottom of the functions.php file? Those can cause problems.

  • @devsingh5286

    @devsingh5286

    6 жыл бұрын

    Here are last lines of code i can see via cPanel file manager. Does the code seem ok. File manager shows last edited oct 24 2017 /** * Returns array of subsets for provided Google Font * @param type $font - Google font * @return array of subsets for provided Google Font */ function re_get_google_font_subset($font) { $subsets = array(); //get google fonts $fontsArray = re_get_google_fonts(); $fontsCount = count($fontsArray->items); for($i=0; $iitems[$i]->family==$font) { for($j=0, $max=count($fontsArray->items[$i]->subsets); $jitems[$i]->subsets[$j]; } break; } } return $subsets; } ?>

  • @igarsnt
    @igarsnt6 жыл бұрын

    Hello Sir. can u please make vid. abut uploading multiple files (jpeg) using wordpress. but the form can use on mobile ( Android ). thanks

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    I don't have an android phone, so that makes a tutorial like that very tricky for me. But I'm not sure it's possible to upload to CF7 from any mobile phone. I'll have to look into it.

  • @fotokolase

    @fotokolase

    6 жыл бұрын

    @@wplearninglab well. any OS smartphone you can try it Sir ;) because multiple files cf7 form not working on android. thanks

  • @b.j.willis2591
    @b.j.willis25916 жыл бұрын

    Very helpful but I'm not quite there yet. I've entered the functions.php coding, customizing to include proper form # and proper thank you page URL. I click "Update File" and get "Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP."

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi BJ, Are you making the edit through your WP Dashboard using the "Editor" under Appearance? If so, the WP developers, in a recent update, decided it was too dangerous to allow people to edit directly in there (they're not wrong). So now, most updates need to be done through FTP or the hosting account... I hope that helps and thanks for watching!

  • @Seomon1
    @Seomon16 жыл бұрын

    This is a great tutorial, I stumbled upon it becaues I want the user to open a new tab to - or download a pdf after he filled out the form. Do I need to use something different than location or can I add an attribute? Also I am asking myself why does the form redirect to location?

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi Simon, could the person who submits the form download the PDF on the thank you page? If not, you could maybe make the destination url the location of the pdf and then it may begin downloading immediately. I haven't tried it. I don't know if you can add an attribute to the destination url, I haven't tried it. But you can open a new tab using JavaScript code. Just google it, you'll find lots of stuff on it. Technically you don't need to have the form redirect to a new page. You can make the destination url the same as the current url and include a parameter in the url. Then you can have JavaScript that detects the url parameter and as a result hides the form and displays a download button for the pdf. Iike that idea, I'll probably make a tutorial for it. It's just a bunch of random thoughts, but I hope that helps!

  • @Seomon1

    @Seomon1

    6 жыл бұрын

    hehe, thank you for that super quick answer! I think the best user experience would be for them to submit ('Download pdf now') and the file gets downloaded immediately, or what I could also imagine - a new tab with the pdf opens up. That was my basic idea. I do like the download page idea as well tho, if you are doing it I am looking forward to the tutorial! :)

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi Simon, I have the tutorial idea on my list. You should try uploading the PDF somewhere on the internet or in your WordPress media library and then adding the link to the PDF to the Javascript and see if that opens the PDF in a new tab or downloads it.

  • @Seomon1

    @Seomon1

    6 жыл бұрын

    Hehe, I was playing with it already, it opens in the same tab.. opening in a new tab might be even better than downloading... altho... dunno, what do you think?

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    I've been doing PDF downloads for a long time and I don't think there's a 100% correct answer. Some people don't like it when a PDF is instantly downloaded, others prefer it. Some people don't like a website creating a new tab for them others don't mind. Some people don't know how to download a PDF that's open in a browser tab, but most do. I don't know the perfect way to do it, but what I do is have the PDF open in a new tab. And if someone has trouble downloading it they usually email me and I attach it to an email.

  • @konstantinprein3951
    @konstantinprein39516 жыл бұрын

    Hi great tutorial, thanks for all this great content! Unfortunately, I get an error Message at the end of the code. The code is pasted like you did, with the pieces of information replaced as shown but there appears the following sequence: There is an error in the last sentence. Please fix that and retry... syntax error, unexpected '}', expecting end of file My end of the file looks like this: ... // do nothing } }, false );

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi Konstantin, According to the error there is one too many '}'. I see that there are three } in the code you pasted, but without the rest of the code I can't see how many { there are. There should the same amount of { and }. Can you paste the full code snippet in here?

  • @dougwmorris
    @dougwmorris5 жыл бұрын

    Hello great video but I keep getting an error that says..... "Your PHP code changes were rolled back due to an error on line 451 of file wp-content/themes/Total/functions.php. Please fix and try saving again. " syntax error, unexpected end of file Any clue why this may be happening

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    Hi Douglas, It's hard to tell without knowing what is on line 451 of your functions.php file. Can you paste the code from that line in here? A 'syntax error' is when there is unexpected character somewhere or when there is no character when one is expected.

  • @dougwmorris

    @dougwmorris

    5 жыл бұрын

    @@wplearninglab Here is the last few lines in the functions.php I wasn't sure if I should put the code before the "new WPEX_Theme_Setup;" or after it but you said all the way at the end so I put it after it. } } new WPEX_Theme_Setup; add_action( 'wp_footer', 'cf7_thank_you_redirect' ); function cf7_thank_you_redirect() { ?> document.addEventListener( 'wpcf7mailsent', function( event ) { if ( '142' == event.detail.contactFormId ) { location = 'wp-phd.com/thank-you-page-1'; } }, false );

  • @rajeevbagri
    @rajeevbagri6 жыл бұрын

    Hi I am learning a lot good things from your videos. Thanks for that. Can i change the function ('wpcf7mailsent'), say for example I have created dropdown list and it contains 2 items. So if anyone selects Item 1 it should redirect to Page 1 (OR) if anyone selects Item 2 it should redirect to Page 2 is there any solution for this if yes then please help. Thanks in advance Love you

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi Rajeev, I'm glad I'm helping you on your WordPress journey :) Thanks for being part of the WPLearningLab community! What you are looking for is possible. You can do almost anything with JavaScript and it's libraries (like jQuery). In this case you would still need use wpcf7mailsent so that redirect happens after someone submits the form. You could make it so immediately after a dropdown choice is selected they are redirected, but then no email would be sent. document.addEventListener( 'wpcf7mailsent', function( event ) { var inputs = event.detail.inputs; if ( 'input-name' == 'name-of-item-1' ) { location = 'url-1'; } else { location = 'url-2'; } }, false ); You'll have to replace "input-name" with the name of the select field in your CF7 builder. And the "name-of-item-1" will need to be replaced with the name of the dropdown item. The code will redirect to url-1 if item one is chosen. If anything besides item one is chosen then it will redirect to the url-2. I haven't tested this code yet, so it may need some tweaking. Does that make sense?

  • @rajeevbagri

    @rajeevbagri

    6 жыл бұрын

    Hi Thanks for the response. As guided by you i have inserted the below code, but unfortunately it is not working. add_action( 'wp_footer', 'cf7_thank_you_page' ); function cf7_thank_you_page() { ?> document.addEventListener( 'wpcf7mailsent', function( event ) { var inputs = event.detail.inputs; if ( 'item-name' == 'Item 1' ) { location = 'URL 1'; } else if ( 'item-name' == 'Item 2' ) { location = 'URL 2'; } else if ( 'item-name' == 'Item 3' ) { location = 'URL 3'; } else { // do nothing }, false );

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Hi Rajeev, Did you replace Item 1, Item 2, and Item 3 with the actual names of the items and didn't you replace URL 1, URL 2 and URL 3 with the actual URLs?

  • @rajeevbagri

    @rajeevbagri

    6 жыл бұрын

    Yes I did. I have sent this just as an example. I will send you my url as my site is fully functional for your suggestion Thanks

  • @jeromewest6823

    @jeromewest6823

    5 жыл бұрын

    Hi, I am too is having problems that this code is not redirecting. See my test example below add_action( 'wp_footer', 'cf7_thank_you_redirect' ); function cf7_thank_you_redirect() { ?> document.addEventListener( 'wpcf7mailsent', function( event ) { var inputs = event.detail.inputs; if ( 'years' == 'sigma1' ) { location = '000.co.za/pmd-sigma1/'; } else if ( 'years' == 'sigma2' ) { location = '000.co.za/pmd-sigma2/'; } else if ( 'years' == 'sigma3' ) { location = '000.co.za/pmd-sigma3/'; } else if ( 'years' == 'sigma5' ) { location = '000.co.za/pmd-sigma5/'; } else if ( 'years' == 'sigma6' ) { location = '000.co.za/pmd-sigma6/'; } else { location = '000.co.za/pmd-sigma/'; } }, false );

  • @jasonscottronmonroe7130
    @jasonscottronmonroe71302 жыл бұрын

    I trust that this is for an older version of WP like just before 6.0??? Your directions don’t jibe with WP 6.0, making it a little harder to follow. Sharing updated videos are a better idea, but thanks for sharing!

  • @skywingtechnical6746
    @skywingtechnical67466 жыл бұрын

    Hello sir, plz suggest me any wordpress plugin for site protection. My all site are down because of the virus attack. Hosting team block my all port. Sir plz suggest me some plugin for protection of my site. Thanks

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    Sorry for the delay. The best plugin for stopping attacks is Sucuri: wplearninglab.com/recommends/sucuri/ The premium version of that plugin is awesome. You may also be served with WordFence (tutorial here: kzread.info/dash/bejne/dYuDspl7e6jdZ9Y.html) and iThemes Security (tutorial here: kzread.info/dash/bejne/oGSElalqirCrhKw.html). I hope that helps and thanks for watching!

  • @skywingtechnical6746

    @skywingtechnical6746

    6 жыл бұрын

    WordPress Tutorials - WPLearningLab Thanks sir

  • @simonelongato
    @simonelongato Жыл бұрын

    but it doesn't actually work!

  • @pinkyrosetumapon927
    @pinkyrosetumapon9275 жыл бұрын

    Hi, nice video. Can I do it with my paypal subscription link instead for thank you page?

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    Hi Pinky Rose, You sure can. You can redirect anywhere you want to. If you're sending them to a PayPal subscription link I recommend you let them know that's going to happen so they're not surprised by it. I hope that helps :) Let me know if you have any further questions. Thanks for watching!

  • @pinkyrosetumapon927

    @pinkyrosetumapon927

    5 жыл бұрын

    @@wplearninglab glad to hear that. just a confirmation, i will follow the same steps and just replace the link with my paypal link right?

  • @pinkyrosetumapon927

    @pinkyrosetumapon927

    5 жыл бұрын

    @@wplearninglab Hi, I tried the code but it gives me an error. it says paypal refuses to connect.

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    That should be how it works, but apparently, it doesn't according to your next question. If you paste the PayPal link you're using into a browser does the page load normally?

  • @pinkyrosetumapon927

    @pinkyrosetumapon927

    5 жыл бұрын

    WordPress Tutorials - WPLearningLab hi thanks for your reply. Its okay now.

  • @royemory800
    @royemory8005 жыл бұрын

    Suggest that you should not modify the theme's function file because it will be overwritten during theme version updates. Instead, create a child theme and modify the child theme's function file. Same results as the video without having to worry about theme updates.

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    Hi Roy, Sorry for the delay. We just had our third baby and it's been a bit of a gong show around here 👶 Great tip. Usually, I do the edits in a child theme or recommend it be done there. I'm surprised I didn't in this video :(

  • @walksofmadridtapastour-foo5556
    @walksofmadridtapastour-foo55566 жыл бұрын

    IT WORKS! BUT THERE IS AN ADDITIONAL PROBLEM: how do you set up event tracking with Google Tag Manager?

  • @wplearninglab

    @wplearninglab

    6 жыл бұрын

    What exactly do you want to track? Visits to the redirect page? Number of submissions?

  • @walksofmadridtapastour-foo5556

    @walksofmadridtapastour-foo5556

    6 жыл бұрын

    I think the best would be tracking the submissions and then find a way to turn these events into GA goals

  • @milletterodriguez3634

    @milletterodriguez3634

    6 жыл бұрын

    Did you find a way to do this already? I have the same question.

  • @walksofmadridtapastour-foo5556

    @walksofmadridtapastour-foo5556

    6 жыл бұрын

    Nope. I took a different route. I gave up events and used the redirect pages as goals on GA.

  • @milletterodriguez3634

    @milletterodriguez3634

    6 жыл бұрын

    Okay question... do you have to add this line to the code that you add on the footer? ga( 'send', 'event', 'Contact Form', 'submit' ); ? I have 3 contact forms that are redirecting to other thank you pages, one thank you page for each contact form and I am not sure how to track them on GA.

  • @abrahamsantana1016
    @abrahamsantana10164 жыл бұрын

    did you delete the code from the blog?

  • @wplearninglab

    @wplearninglab

    4 жыл бұрын

    Hi Abraham, If the code is not there it's not on purpose. I'll check it out.

  • @abrahamsantana1016

    @abrahamsantana1016

    4 жыл бұрын

    @@wplearninglab Thanks I appreciate that

  • @-30h-work-week
    @-30h-work-week4 жыл бұрын

    I don't like the fact that it redirects to the thank-you page only after it confirms the info being submitted. :) I want the user to not get any confirmation. I want him to know the info's been submitted only when he sees the page he gets redirected to.

  • @localdelivery1742
    @localdelivery17425 жыл бұрын

    Just wanted to say great videos. Just came across this plug called Code Snippet by By Shea Bunge. Can you check it out and tell me if this is a better way. Thanks and again keep up the great work.

  • @wplearninglab

    @wplearninglab

    5 жыл бұрын

    Sorry for the delay in responding. Code Snippet is a good looking plugin. I've tested it on my site and it works well. It's definitely an alternative to adding code to the functions.php file. The only downside is adding another plugin to your site. If you're okay with that then it's a great option. I hope that helps and thanks for watching! P.S. If you haven't yet, check out the WPLearningLab Facebook Group: facebook.com/groups/wplearninglab See you there!

Келесі