Block specific domain
-
I have a problem with my blog because a lot of emails are sent to one of these emails (different account some domain):
- gemmasmith.co.uk
- jenniferlawrence.uk
- b-mail.online
- katykahn.co.uk
- sarahconner.co.uk
- marymarshall.co.uk
I don’t understand why the blog is sending all those emails. So, I tried to block the registration for those domains. First, I added in the function.php of the theme the following code
// prevent user registration in wordpress from specific domain function wpcs_disable_email_domain ( $errors, $sanitized_user_login, $user_email ) { list( $email_user, $email_domain ) = explode( '@', $user_email ); if ( strpos($email_domain, 'b-mail.online') != false || strpos($email_domain, 'dynainbox.com') != false || strpos($email_domain, 'gemmasmith.co.uk') != false || strpos($email_domain, 'marymarshall.co.uk') != false || strpos($email_domain, 'katykahn.co.uk') != false || strpos($email_domain, 'roastedtastyfood.com') != false ) { $errors->add( 'email_error', __( '<strong>ERROR</strong>: Domain not allowed.', 'my_domain' ) ); } return $errors; } add_filter( 'registration_errors', 'wpcs_disable_email_domain', 10, 3 );
but the emails are still sending. Then, I tried different plug-in like Ban Hammer or WP Security. Nothing.
Could you help me to understand how to block all those emails to these domains?
Thank you advance,
EnricoThe page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Block specific domain’ is closed to new replies.