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