Forbid Bad Usernames

What It Does

Forbid Bad Usernames refuses a username or a display name that is on the disallowed list.

Some entries in that list end with *. The star stands for a varying ending, often a number used by malware. A new username that starts with the text before the star is refused. Example: adm* refuses adm1 and admtest.

The wildcard is enforced where WordPress would otherwise compare the name exactly:

  • the front-end registration form;
  • creation of a new account;
  • the users REST API, for a new login and for a display name;
  • the profile form, for the login and for the display name, including an account that already exists.

Saving an existing account through WordPress’s exact login list does not, by itself, reject a login that only matches a wildcard. The profile form still does.

The separate checkbox Forbid «admin» Usernames still refuses any new name that contains admin, except the account whose login is exactly admin.

Why It Matters

WordPress compares a disallowed login with an exact match. A pattern such as adm* never matched, so those names could be registered. The same gap existed on the registration form and on the REST API.

How to Use

Open the Users & Login module and enable Yes, prevent users from using disallowed usernames and display names.

There is no field to type extra wildcards. The patterns come from the disallowed list shipped with SecuPress. The list can be changed with the secupress.plugins.disallowed_logins_list filter.