Skip to content

// website builders and cms

Via API

WordPress email verification with pingutil

WordPress registration is a favorite target for scripts that sign up with temp-mail and gibberish addresses, and every one becomes a row in wp_users and a bounce in your mail logs. Hooking the registration_errors filter lets a small must-use plugin ask pingutil about the address and add a WP_Error before the account is created. If pingutil is slow or unreachable, the registration goes through.

Where it connects: registration_errors filter (plus woocommerce_registration_errors for WooCommerce)

What goes wrong without it

  • Hundreds of new subscribers with mailinator and yopmail addresses show up overnight and none of them ever log in.
  • Our welcome and password emails bounce off fake addresses and the host started warning us about mail reputation.
  • A CAPTCHA plugin cut the bot traffic but people still register with throwaway inboxes to grab the member download.

What you can do with WordPress and pingutil

  • Reject disposable and random addresses at wp-login.php?action=register

    The filter runs inside register_new_user() before the user row is written. Call /v1/lookup with skip_enrichment: true and add an error when verdict.is_spam is true, so temp-mail domains and strings like ccjxx90sze@gmail.com never get an account.

  • Cover WooCommerce My Account and checkout signups

    WooCommerce creates customers through wc_create_new_customer(), which applies woocommerce_registration_errors instead. Point the same function at both filters so store accounts get the same check.

  • Flag low-trust signups for review instead of blocking

    Role and system addresses (info@, noreply@) come back with verdict.low_trust. Let them register and store verdict.reason in user meta from the user_register action, so an editor can review them later.

Set it up

  1. 1

    Create an API key in the pingutil dashboard and add it to wp-config.php as define( 'PINGUTIL_API_KEY', 'pk_live_...' ).

  2. 2

    Save the plugin below as wp-content/mu-plugins/pingutil-registration-check.php. Must-use plugins load automatically and cannot be deactivated from the admin screen.

  3. 3

    Keep the 3-second timeout and the fail-open branches: any WP_Error, non-200 status or 429 lets the registration through.

  4. 4

    Register with test@mailinator.com to confirm the error shows on the form, then with your own address to confirm it passes.

  5. 5

    If you run WordPress Multisite, wire wpmu_validate_user_signup separately; network signups do not pass through registration_errors.

wp-content/mu-plugins/pingutil-registration-check.php
<?php
/**
 * Plugin Name: pingutil registration check
 * Description: Rejects disposable and machine-generated emails at registration. Fails open.
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

function pingutil_is_spam_email( string $email ): bool {
	if ( ! defined( 'PINGUTIL_API_KEY' ) || '' === PINGUTIL_API_KEY || get_transient( 'pingutil_backoff' ) ) {
		return false;
	}

	$response = wp_remote_post(
		'https://pingutil.com/v1/lookup',
		array(
			'timeout' => 3,
			'headers' => array(
				'Authorization' => 'Bearer ' . PINGUTIL_API_KEY,
				'Content-Type'  => 'application/json',
			),
			'body'    => wp_json_encode( array( 'input' => $email, 'skip_enrichment' => true ) ),
		)
	);

	if ( is_wp_error( $response ) ) {
		error_log( 'pingutil skipped: ' . $response->get_error_code() );
		return false; // Timeout or network error: fail open.
	}

	$code = (int) wp_remote_retrieve_response_code( $response );
	$data = json_decode( wp_remote_retrieve_body( $response ), true );

	if ( 429 === $code ) {
		$wait = isset( $data['retry_after_seconds'] ) ? max( 1, (int) $data['retry_after_seconds'] ) : 60;
		set_transient( 'pingutil_backoff', 1, $wait );
		return false;
	}

	return 200 === $code && ! empty( $data['verdict']['is_spam'] );
}

function pingutil_registration_errors( WP_Error $errors, string $email ): WP_Error {
	// Core already rejected the form (empty, malformed, taken): skip the call.
	if ( $errors->has_errors() || '' === $email ) {
		return $errors;
	}
	if ( pingutil_is_spam_email( $email ) ) {
		$errors->add( 'pingutil_blocked_email', __( '<strong>Error:</strong> Please register with a permanent email address.' ) );
	}
	return $errors;
}

// wp-login.php?action=register
add_filter(
	'registration_errors',
	function ( $errors, $sanitized_user_login, $user_email ) {
		return pingutil_registration_errors( $errors, (string) $user_email );
	},
	10,
	3
);

// WooCommerce My Account and checkout account creation
add_filter(
	'woocommerce_registration_errors',
	function ( $errors, $username, $email ) {
		return pingutil_registration_errors( $errors, (string) $email );
	},
	10,
	3
);

What to do with each result

pingutil resultAction in WordPress
verdict.is_spam: true (reason disposable_domain or randomized_local_part)Add a WP_Error in registration_errors; no user is created.
verdict.low_trust: true (role_based, system_generated)Allow the registration and save verdict.reason to user meta for review.
category: "company"Optionally tag the user as a business signup from user_register.
Timeout, 5xx or 429 rate_limitedReturn $errors unchanged so the visitor can register; back off for retry_after_seconds.

Limits to plan for

  • The hook uses fast mode (/v1/lookup with skip_enrichment), which classifies the address but does not open an SMTP session. A real-looking Gmail address with a dead mailbox still passes; run /v1/verify after signup if you need mailbox-level checks.
  • Users created by admins, the REST API or Multisite signups do not pass through registration_errors or woocommerce_registration_errors.
  • Privacy-relay addresses (Apple Hide My Email, Firefox Relay) can be flagged as randomized_local_part. Watch your logs if your audience uses them.

WordPress documentation

WordPress is a trademark of its owner. This integration uses WordPress's documented extension points; it is not an official WordPress app.

Common questions

Does registration_errors run for WooCommerce signups?
No. WooCommerce creates customers with wc_create_new_customer(), which applies woocommerce_registration_errors. Hook both filters if your site uses both forms.
Where should the pingutil key live in WordPress?
In wp-config.php as a constant. It stays server-side, survives plugin updates and is not part of database exports. Never put it in theme JavaScript.
Does this replace a CAPTCHA?
No. A bot using a plausible Gmail address passes an email check. Keep a challenge on the form and use the email check to catch the throwaway and machine-generated addresses that get past it.

Stop bad addresses in WordPress today

Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your WordPress setup will receive.