Forum in maintenance, we will back soon 🙂
Those pesky i.t.s.m.e.@gmail.com user registrations
Here is a code snippet to stop emails with more than 2 '.' in the user part of the email address. Adjust the 2 or add more conditions as you see fit.
function validate_email_on_registration($errors, $sanitized_user_login, $user_email) { $INV = 'invalid_email'; $MSG = __('<strong>ERROR</strong>: Invalid email address.'); if (is_email($user_email)) { $user = explode('@', $user_email)[0]; $uparts = explode('.', $user); if (count($uparts) > 2) { $errors->add($INV, $MSG); } } return $errors; } add_filter('registration_errors', 'validate_email_on_registration', 10, 3);
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack
Thanks for sharing. In your experience, are these emails spammy?
@admin yes they're spammish and many aren't deliverable because the accounts get removed before they can get the confirmation email to make the password change. In the case of gmail you can add as many periods as you want in the name portion of the email because their server removes all of them so no matter how you format the name portion it is always deliverable to your account. This is true even if you register your gmail account with a period, gmail will remove the period on the server side.
Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack