Blacklist Words on Registration
Blacklisting words helps identify and block undesirable content from entering your system or site. This setting prevents users from creating malicious usernames and reduces the risk of fraud.
How to Add a Blacklist Word
- Navigate to WP Admin > Ultimate Member > Settings.
- Click on the Access tab.
- Click the Other subtab.
- Locate the Blacklist Words field.
- Enter the words you want to blacklist.
Default Blacklist Words
By default, Ultimate Member blocks the following usernames:
admin administrator webmaster support staff
Important Notes:
- Each word must be entered on a new line.
- If a user tries to register with a blacklisted word in their username, they will receive an error message stating that the username is not allowed.
Case Sensitivity in Blacklisted Words
Ultimate Member automatically checks usernames in a case-insensitive manner. If a user tries to register using a blacklisted word with mixed uppercase and lowercase letters, the registration will still be blocked.
For example, if admin
is blacklisted:
Admin
,ADMIN
, orAdMiN
will also be blocked.- A message will appear stating that the chosen username is not allowed.
Converting Uppercase to Lowercase for Blacklisted Words
To ensure accurate word comparison, you can use the following code snippet to validate blacklisted words in lowercase:
Explanation:
- This code converts the entered username to lowercase before checking it against the blacklist.
- Ensures a more reliable filtering of blacklisted words.
Summary
- Blocked Email Addresses: Prevent specific email addresses and domains from registering.
- Blacklisted Words: Prevent specific words from being used in usernames.
- Case Insensitivity: Both email addresses and usernames are checked without regard to uppercase/lowercase differences.
- Custom Validation: Code snippets can be used to convert entries to lowercase for more accurate blocking.
These features enhance security by preventing spam, malicious registrations, and fraudulent activity on your website.