Block Email address on Registration
Ultimate Member provides an option to block specific email addresses from registering on your site. This feature helps protect your website from spam, malicious users, and unwanted registrations.
How to Block an Email Address
To block an email address, follow these steps:
- Navigate to your WordPress dashboard.
- Go to WP Admin > Ultimate Member > Settings.
- Click on the Access tab.
- Click on the Other subtab.
- Locate the Blocked Email Addresses field under Blocked data when sign up.
- Enter the email addresses you want to block and click the Save Changes button.
Important Notes:
- Each email address must be entered on a new line.
- If you want to block multiple addresses, ensure that each one is listed separately.
Example:
When a user attempts toregister or sign in with a blocked email address, they will receive an error message stating that their email address is not allowed.
Blocking an Entire Domain
Ultimate Member also allows you to block all email addresses from a specific domain. This is useful if you want to prevent users from registering with email providers known for spam.
How to Block a Domain
- To block all emails from a specific domain, use the wildcard asterisk
*
followed by the domain name. e.g *gmail.com - Example:
- If an email address contains the blocked domain, the user will not be able to register and will see an error message stating that registrations from that domain are not accepted.
Case Sensitivity and Email Blocking
Ultimate Member automatically checks email addresses in a case-insensitive manner. This means that even if a user enters an email with mixed uppercase and lowercase letters, it will still be blocked if it matches an entry in the "Blocked Email Addresses" list.
For example, if spamuser@example.com
is blocked:
SpamUser@Example.com
will also be blocked.- A message will appear informing the user that their email address has been blocked.
Converting Uppercase Emails to Lowercase
If you want to ensure that all email addresses entered during registration are compared in lowercase, you can use the following code snippet:
Explanation:
- This code hooks into the Ultimate Member registration process.
- It converts the entered email address to lowercase before it is checked against the blocked list.
- This ensures a more accurate match when comparing blocked email addresses.
Summary
- You can block specific email addresses by adding them to Blocked Email Addresses in Ultimate Member Settings.
- Blocking entire domains is possible by using the wildcard
*
(e.g.,*@example.com
). - Email blocking is case-insensitive.
- You can implement a code snippet to convert all email entries to lowercase for accurate comparison.
This feature enhances site security by preventing spam registrations and reducing the risk of malicious users gaining access.