CAPTCHA Cat WordPress plugin for protecting login, registration, and comment forms.
Full Example
A complete working example is available on GitHub: Captchacat-Integrations/Wordpress
Installation#
- Copy the plugin folder to
wp-content/plugins/captcha-cat - Activate the plugin in Plugins > Installed Plugins
- Go to Settings > CAPTCHA Cat
- Enter your credentials and enable protection
Configuration#
Navigate to Settings > CAPTCHA Cat to configure:
| Setting | Description |
|---|---|
| Base URL | Your CAPTCHA Cat 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:
[captcha_cat]PHP Function
Add the CAPTCHA in your theme or plugin:
<?php captcha_cat_render(); ?>Manual Validation
For custom form handlers:
<?php
$token = $_POST['captchacat-token'] ?? '';
$result = Captcha_Cat_Validator::validate($token);
if ($result['valid']) {
// Process the form
} else {
// Show error
echo $result['message'];
}Hooks#
Filter: Modify Validation Result
add_filter('captcha_cat_validation_result', function($result, $token) {
// Custom logic
return $result;
}, 10, 2);Action: After Successful Validation
add_action('captcha_cat_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 CAPTCHA Cat server
- Ensure your domain is registered in the CAPTCHA Cat Dashboard