• Resolved erinflockhart

    (@erinflockhart)


    Is it possible to use wildcards to restrict domains that can register? I’m having problems with spammers registering with multiple subdomains to get around the restrictions I place on the main domain. I’ve tried typical wildcards such as *domain.com but nothing works. Is there a wildcard that works for this or even an option to block all subdomain email addresses from registering?

Viewing 1 replies (of 1 total)
  • Plugin Support alexandrubodea

    (@alexandrubodea)

    Hi @erinflockhart,

    Unfortunately, the use of wildcards is not possible in the “Email Domains Registering” setting. Maybe you can further adapt the following custom code so that you add extra validations to the email field.

    function wppbc_check_email_value( $message, $field, $request_data, $form_location ){
    global $wpdb;

    if ( isset( $request_data['email'] ) ) {

    if ((isset($request_data['email']) && (trim($request_data['email']) == '')) && ($field['required'] == 'Yes'))
    return wppb_required_field_error($field["field-title"]);

    }

    return $message;
    }
    add_filter( 'wppb_check_form_field_default-e-mail', 'wppbc_check_email_value', 20, 4 );

    Keep in mind that the above code is just an example and at the moment it only makes a validation to see if the field is empty or not (which is already done by the plugin). You will need to further adapt that code to your liking.

    You can add the code to your site by adding it to your theme’s ‘functions.php’ file or by creating a new plugin as described here.

    Note: As with any modifications, is always recommended to do a backup of your site before proceeding.

    Note 2: To help with the fight against spam registrations, you can also use the reCaptcha field. We also introduced the reCaptcha v3 implementation to our field.

    Best regards,

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.