• Resolved adventurearckids

    (@adventurearckids)


    Good day. I would like to know how I can block submissions that contain certain words like job or SEO.

    There is no option that I can see. I want to be able to automatically block submissions that contain certain words and Akismet only allows for blocking IP.

    Thanking you in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @adventurearckids,

    I hope you are doing good.

    Unfortunately, Forminator does not have a built-in feature to address this requirement. I’ve reached out to our developers to check the possibility of offering a temporary solution, and we’ll provide updates here as soon as we receive feedback.

    Kind Regards,
    Nebu John

    Plugin Support Laura – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @adventurearckids,

    Hope this message finds you well.

    add_filter( 'forminator_custom_form_submit_errors', 'wpmudev_moderate_form_submission', 10, 3 );
    function wpmudev_moderate_form_submission( $submit_errors, $form_id, $field_data_array ) {
        if ( $form_id != 6 ) { // Please change the form ID.
            return $submit_errors;
        }
    
        $submitted_data = Forminator_CForm_Front_Action::$prepared_data;
    
        if ( ! empty( $submitted_data ) ) {
            $restricted_words = array( 'job', 'seo' ); // Please add restricted words.
            $submitted_data = implode( ',', $submitted_data );
            foreach ( $restricted_words as $key => $value ) {
                if ( stripos( $submitted_data, $value ) !== false ) {
                    $submit_errors[]['submit'] = 'Form should not contain restricted words';
                }
            }
        }
    
        return $submit_errors;
    }

    Note that Form ID 6 should be changed and restricted words should be added in the array $restricted_words.

    You might need to install this as a mu-plugin, kindly follow this guide:

    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Let us know the results.

    Best regards,
    Laura

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @adventurearckids,

    Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to open a new thread if you have new queries.

    Best Regards
    Nithin

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blacklising Words’ is closed to new replies.