Hook for Validating Custom Forms
Please note that the Anti-Spam plugin must be installed and activated in order to the special hooks in WordPress.
Simply add a check using the hook apbct_wordpress_protect_from_spam by passing the POST or GET data from the form:
                                
                                    
                                
                               $result = apply_filters('apbct_wordpress_protect_from_spam', $_POST);
And get the result: $result['is_spam'] = '0' or '1'. Accuracy: 99.998%. After the visitor submits the form, the request reaches your form handler.
In the handler, add the following filter: $result = apply_filters('apbct_wordpress_protect_from_spam', $_POST);
After the check, the result will be stored in the $result array:
                                
                                    
                                
                               [
    'is_spam' => '0',
    'message' => '',
 ];
If 'is_spam' => 1, the message will contain the reason for blocking:
                                
                                    
                                
                               [
    'is_spam' => '1',
    'message' => '*** Forbidden. Sender blacklisted. Anti-Spam by CleanTalk. ***',
 ];
What you do with this message is up to you. If you want to automatically redirect the spammer to a block page, specify the redirect_to_block_page parameter:
                                
                                    
                                
                               $result = apply_filters('apbct_wordpress_protect_from_spam', $_POST, ['redirect_to_block_page' => true]);
In this case, the spammer will be automatically redirected to the block page. The protection works when the plugin is enabled and the service is active.
It would also be interesting
- CleanTalk Anti-Spam check_message API MethodCleanTalk Anti-Spam "check_message" API method description This method is the best to use on forms that...
 - The Real Person Badge | CleanTalk Anti-SpamThe Real Person Badge A benchmark system for WordPress that separates real users from bots. The...
 - TeamCleanTalk Team Denis The godfather and CEO of CleanTalk Inc.Drop a message anytime. But do it with...