Skip to content

v1.3.1 — Suppress registration notification emails

Choose a tag to compare

@schlebek schlebek released this 27 May 09:28
· 1 commit to master since this release

What's new

Two additional email suppression filters, closing a gap where the admin still received a "New User Registration" email even though the registration itself was blocked.

Problem

WordPress sends the "New User Registration" notification email after a successful wp_insert_user(). In most cases this email never arrives because wp_pre_insert_user_data prevents the insert. However, certain plugins (WooCommerce checkout flow, custom AJAX handlers) can invoke wp_new_user_notification() in a code path that partially bypasses the insert guard, causing the notification to fire even though no account was ultimately created.

Fix

  • wp_new_user_notification_email_admin (priority 99) — suppresses the WordPress admin notification for any registration not initiated by a logged-in user with create_users capability. Admin-created accounts are unaffected.
  • woocommerce_email_enabled_customer_new_account (priority 99) — suppresses the WooCommerce "New account" email for the same condition.

If notification emails persist after this update, the source is likely a form builder (Contact Form 7, WPForms, Gravity Forms) or a security monitoring plugin sending its own alerts. Check the email From: / X-Mailer headers to identify the sender.