• Hello Contact Form 7 Community,

    I am a website owner and I am looking to improve the security of my website. I have installed the Contact Form 7 plugin on my WordPress site and I would like to add an Anti-CSRF token to the forms on my website to prevent CSRF attacks.

    I have attempted to add the token myself using various tutorials, but I have not been successful. I was hoping that someone in the Contact Form 7 community could provide some guidance or assistance in adding the Anti-CSRF token to Contact Form 7 on my website.

    If anyone has experience with this or has any resources or tutorials that could help me achieve my goal, I would greatly appreciate it. Thank you in advance for your time and consideration.

    Best regards,

    Ujjawal Poonia

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi Team,


    //Below function used to create boldid account and opportunity when submit the Schedule demo or request quote

    function on_submit($form, &$abort, $submission){ $submission = WPCF7_Submission::get_instance();

    $wpcf7 = WPCF7_ContactForm::get_current();

    $posted_data = $submission->get_posted_data();

    add_filter(‘wpcf7_verify_nonce’, ‘__return_true’);

    if ($form->ID() == 47037 || $form->ID() == 41939) {

    $bold_api_data = array( “FirstName” => $posted_data[“FirstName”], “LastName” => $posted_data[“LastName”], “Email” => $posted_data[“Email”], “Contact” => $posted_data[“Phone”], “Company” => $posted_data[“Company”], “Origin” => (int)$posted_data[“Origin”], “PolicyConsentOriginId” => (int)$posted_data[“PolicyConsentOriginId”], “ProductConsentId” => (int)$posted_data[“ProductConsentId”] );

     …

    is it fine to add wpnonce filter at mentioned place?

    we have added at the end of function php file eventhough the csrf issue was reported, please guide us with this issue to resolve.

    errorPlacement: function(error, element) {
    ? element.after(error);
    }
    });
    });
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'blogpost_comment_validation');
    add_filter('wpcf7_verify_nonce', '__return_true');
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Adding Anti-CSRF Token to Contact Form 7’ is closed to new replies.