If you’re using AJAX to submit your contact form 7 data ( which is turned on by default ) you won’t be able to redirect using the wpcf7_before_send_mail
hook. You have a few other options though:
1) Turn off WPCF7 AJAX which is packaged into an entire JS flag. This will also turn off JS validation and all around not optimal. Documentation. Add this to wp config
define('WPCF7_LOAD_JS', false);
2) Use the built-in WPCF7 Additional Settings Field field on your contact form to handle the redirect on submission. It looks something like this:
on_sent_ok: "location = 'http://yourdomain.com/info-contratar/';"
3) Use jQuery either on the page or in an external file and listen mailsent.wpcf7
. Documentation.
jQuery( document ).ready( function( $ ) {
$( '.wpcf7' ).on( 'mailsent.wpcf7', function( e ) {
window.location.href="http://yourdomain.com/info-contratar/";
} );
} );
Related Posts:
- How to add placeholder for contact form7 for dropdown? [closed]
- How to execute a server side script when contact form 7 is submitted? [closed]
- Contact Form 7 – add custom function on email send [closed]
- How to resolve “Failed to send your message” problem for Contact Form 7? [closed]
- How to choose email recipient in Contact Form 7 based on address state input in form and save to database [closed]
- Adding a hyperlink to the checkbox in the contact form 7 [closed]
- Horizontal (columned) Contact form 7 and acceptance field on devices
- Contact form 7 dynamic text extension – populate form with title from previous page [closed]
- Insert Captcha Code info Any Form (Created of Plugin)
- How to programmatically send additional notification emails in Contact form 7 [closed]
- Prevent CF7 attachment from being deleted [closed]
- How to use WPML Plugin in contact form 7
- search form results – dynamically adding email addresses to contact form 7 [closed]
- Contact form 7 is sending an unwanted autoresponse [closed]
- Contact Form 7 add ID to radio buttons [closed]
- Contact Form 7 – Send attachment to submitter? [closed]
- Modify Contact Form 7 input value before submission
- Align reCaptcha to right on Contact Form 7 [closed]
- Contact Form 7 – Debugging email send failres [closed]
- Error installing Contact Form 7 [closed]
- Contact Form 7: Email custom HTML inputs or make a field readonly [closed]
- CF7 conditional logic [closed]
- How i can remove span in the CF7 without touching error span?
- How to the make dropdown for contact form7 work responsively with mobile? [closed]
- Trigger shortcode after submit button pressed [closed]
- Adding form field dynamically
- Can’t add more than one attachment to Contact Form 7 [closed]
- Is there a way to let user add and remove fields with Contact Form 7? [closed]
- How to set placeholder to dropdown in contact form 7? [duplicate]
- WordPress Contact Form 7 Image Size Validation [closed]
- 2-step contact form, URL field on the site, others inside popup [closed]
- contact form 7 does not show after update [closed]
- Pop-up successful message in Fancybox? [closed]
- CF7 Split/Separate fields [closed]
- Add php variables to custom form submission [closed]
- Can I customize the To Email address on Contact Form 7? [closed]
- Contact Form 7 pre email processing [closed]
- How can I safely override contact form 7 styles? [closed]
- When I try and use contact form 7 it breaks my page [closed]
- Contact form 7 shortcode appear outside form tag
- Contact Form 7- problem with submit button [closed]
- customize the body of the autoresponder email [closed]
- How to reset multiple captcha on same page with contact form 7? [closed]
- How to add permalinks to contact form 7 [closed]
- Adding attributes to HTML tags in Contact Form 7 [closed]
- post_content with Contact Form 7 [closed]
- action for ‘contact form 7’? [closed]
- Confirmation email Contact Form 7 [closed]
- Adding custom attributes to input fields in Contact Form 7 tags
- How to put a contact form inside the footer of all the articles and pages of a website? [closed]
- Related Drop down list
- How to Send Confirmation Emails to Users after Form Submission?
- donwload pdf file after contactform 7 submisson
- Contact Form 7 diferent contact identification for same site [closed]
- How to insert entire page content into CF7 form submission?
- Contact Form 7 – how manipulate data before mail is sent? [closed]
- Contact form 7 Adding data automatically [closed]
- Using contact form 7 with easy fancybox [closed]
- Styling Contact Form 7 fields [closed]
- Limit one submission from each user using Contact Form 7? [closed]
- Which contact form plugin passes Outlook junk / spam filters? [closed]
- Contact Form 7 Custom module [closed]
- Contact form 7 add automatic =0A character in place of break
- Contact form 7 radio button default:get
- Contact7 Check Boxes line breaks when submitted
- The dropdown menu for contact 7 forms is not responsively with mobile device
- Change FROM name in mail inbox when sending email through Contact Form 7
- Contact Form 7: conditional logic in e-mail
- create a new section in divi after sending a contact form
- Add Line Break/Remove Commas for Checkbox options sent via Email from Contact Form 7 [closed]
- Is there a way for users only saved in the contact form 7 database to view a wordpress private page?
- Form behaving differently on small screens vs desktop screen
- Filter multiple dynamic dropdown lists within one form using the Smart Grid-layout extension for Contact Form 7
- How to pass POST data from Contact Form 7 to another subpage after submitting the form
- Additional Headers: Contactform7
- Contact Form 7 – save_posted_data with specific form
- Contact Form 7 – multiple recepients
- Contact form 7 refreshes page after pressing submit button and does not send anything
- How to direct contact form submission to a certain page
- Contact Form 7 multi-column form error
- single quote in contact form 7 input field throwing error on form submission
- Contact form db plugin customization
- Contact form 7 – automatic email delay
- Installing plugin Contact Form 7 fails [closed]
- How to Prevent Unwanted Spam to Contact Form 7 [closed]
- I want to show contact form 7 on lightbox [closed]
- How to Integrate MailChimp with Contact Form 7 [closed]
- How to pull and auto display custom fields values to contact form
- How to save data in my db table with using contact form seven?
- docx filetype upload issue with contactform7 [closed]
- Contact-7 multi screen dashboard
- Contact Form 7 get_posted_data(); is not returning posted values [closed]
- Restrict MIME type files in upload field + contact form 7
- Very slow ajax request from Contact Form 7
- How do I use Mail (2) auto-responder with a multi-step contact form 7?
- Display QR Code in e-mail after submit contact form
- Contact Form 7 – Display Dropdown, Send Different Data
- Dynamic values in Contact form 7 [closed]
- CF7 Wont submit contact form on apple iphones [closed]
- Contact Form 7 – how to disable spinner the right way