• Plugin Support andrewsupport

    (@andrewsupport)


    Question:
    How do I add Captcha to my custom PHP or HTML form in WordPress?

    Answer:
    Follow these steps to integrate Captcha into your custom form:

    1. Install and Activate: Ensure the Captcha plugin is installed and active.
    2. Customize Settings (Optional): Add your form to the plugin settings via a functions.php update:
      • Use the cptch_add_form filter hook to register your form.
      • Avoid predefined slugs like wp_login or woocommerce_register.
    3. Modify Your Form: Add the following code to display the Captcha:phpCopy code<?php echo apply_filters( 'cptch_display', '' ); ?>
    4. Validate Input: Use this code to check Captcha validity:phpCopy code <?php $error = apply_filters( 'cptch_verify', true ); if ( true === $error ) { // CAPTCHA passed. } else { echo $error; // Display error message. } ?>

    Visit your plugin settings to enable and configure Captcha for the form under “External Plugins”. If further issues arise, share your code or error details for assistance!

The topic ‘Captcha Not Showing on Custom Forms?’ is closed to new replies.