Monday, June 13, 2022
HomeWordPress Developmentspam - Block to just accept and ship e-mail to particular domains

spam – Block to just accept and ship e-mail to particular domains


I’ve an issue with my weblog as a result of quite a lot of emails are despatched to certainly one of these emails (totally different account some area):

  • gemmasmith.co.uk
  • jenniferlawrence.uk
  • b-mail.on-line
  • katykahn.co.uk
  • sarahconner.co.uk
  • marymarshall.co.uk

I do not perceive why the weblog is sending all these emails. So, I attempted to dam the registration for these domains. First, I added within the operate.php of the theme the next code

// stop consumer registration in wordpress from particular area
operate wpcs_disable_email_domain ( $errors, $sanitized_user_login, $user_email ) {
    checklist( $email_user, $email_domain ) = explode( '@', $user_email );
    if ( strpos($email_domain, 'b-mail.on-line') != 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', __( '<sturdy>ERROR</sturdy>: Area not allowed.', 'my_domain' ) );
    }
    return $errors;
}
add_filter( 'registration_errors', 'wpcs_disable_email_domain', 10, 3 );

however the emails are nonetheless sending. Then, I attempted totally different plug-in like Ban Hammer or WP Safety. Nothing.

Might you assist me to grasp easy methods to block all these emails to those domains?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments