• Colin Glenn

    (@colinglenn)


    Yes I want to redirect to a new URL, I buried the Contact Us form on another page to get more room on my home page, so I would like to redirect the visitor back to the home page.

    I did read the page in the FAQ wpcf7mailsent and can do that, though needing it in my main template just for a single page is, silly, …

    However, am not sure if can be done: On redirect to home page, can have the message about successfully being sent posted or available for posting / displaying?

Viewing 1 replies (of 1 total)
  • cassandravizisites

    (@cassandravizisites)

    If you’re not using a specific theme that allows you to add “Raw HTML or JS” as an element in your page then you can simply add this code to your header.php file, in this format (before the </head> tag):
    <script>
    document.addEventListener( ‘wpcf7mailsent’, function( event ) {
    location = ‘https://example.com/&#8217;;
    }, false );
    </script>

    (Just fair warning that this method will be populated on every page. So if you want it on a specific page, you’ll need to create a template or find a way to use raw html elements in your pages.)

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect To URL’ is closed to new replies.