WordPress Registration Hook Email Verification Guide
Add real-time email verification and disposable-email blocking to WordPress Registration Hook with the VeriShield Edge API. The snippet below gates a signup and returns the canonical email identity.
Language
PHP 8.3
Ecosystem
WordPress / WP HTTP API
Latency
< 85ms
Install
Shell
Add to theme functions.php or a custom pluginVerification code
PHP 8.3
add_filter('registration_errors', function ($errors, $login, $email) {
$resp = wp_remote_post('https://verishield-edge-api.p.rapidapi.com/v1/verify', [
'headers' => ['X-RapidAPI-Key' => getenv('RAPIDAPI_KEY'), 'Content-Type' => 'application/json'],
'body' => wp_json_encode(['email' => $email]),
'timeout' => 3
]);
$data = json_decode(wp_remote_retrieve_body($resp), true);
if (($data['fraud_risk']['recommendation'] ?? '') === 'BLOCK') {
$errors->add('disposable_email', 'Disposable email addresses are not allowed.');
}
return $errors;
}, 10, 3);What this protects against
Disposable and temporary inboxes, Gmail dot-trick and plus-alias multi-accounting, high-entropy bot usernames, and freshly registered fraud domains. The API returns a 0-100 fraud score with an ALLOW, CHALLENGE_2FA or BLOCK recommendation.