ByeBot WordPress plugin for protecting login, registration, and comment forms.
Full Example
A complete working example is available on GitHub: Byebot-Integrations/Wordpress
Installation#
- Copy the plugin folder to
wp-content/plugins/byebot - Activate the plugin in Plugins > Installed Plugins
- Go to Settings > ByeBot
- Enter your credentials and enable protection
Configuration#
Navigate to Settings > ByeBot to configure:
| Setting | Description |
|---|---|
| Base URL | Your ByeBot server URL |
| API Key | Secret key for server-side validation |
| Site Key | Public key for the widget |
Built-in Protection#
Enable protection for WordPress forms with checkboxes:
- Login Form - Protects
/wp-login.php - Registration Form - Protects user registration
- Comment Form - Protects blog comments (logged-in moderators are skipped)
Custom Forms#
Shortcode
Add the CAPTCHA to any page or post:
[byebot]PHP Function
Add the CAPTCHA in your theme or plugin:
<?php byebot_render(); ?>Manual Validation
For custom form handlers:
<?php
$token = $_POST['byebot-token'] ?? '';
$result = Byebot_Validator::validate($token);
if ($result['valid']) {
// Process the form
} else {
// Show error
echo $result['message'];
}Hooks#
Filter: Modify Validation Result
add_filter('byebot_validation_result', function($result, $token) {
// Custom logic
return $result;
}, 10, 2);Action: After Successful Validation
add_action('byebot_validated', function($token) {
// Log successful validation
});Troubleshooting#
Widget Not Showing
- Check that the plugin is activated
- Verify your Site Key is correct in Settings
- Check browser console for JavaScript errors
Validation Always Fails
- Verify your API Key is correct
- Check that your server can reach the ByeBot server
- Ensure your domain is registered in the ByeBot Dashboard