Since 3.28.0 lh-profile-page provides one shared helper for suggesting a gender from a first name: LH_Profile_First_Name_Gender::suggest( $first_name ) (includes/class-lh-profile-first-name-gender.php). Every plugin that infers gender from a name, such as email ingestion enrichment, imports or bulk fills, should call it rather than run its own lookup, so the same rules apply everywhere. LH User Provisioning (1.5.0+) also uses it to tell which part of an email address is the first name. Guard calls with class_exists( 'LH_Profile_First_Name_Gender' ).
What it returns
'Male' or 'Female' when the name clearly reads as that gender, otherwise ''. It is deliberately conservative: getting no suggestion is always better than a wrong one. The checks run in this order:
- Not a first name. Empty values, email addresses, anything containing a digit and single-letter initials give nothing.
- Ambiguous names. A name on the ambiguous list (case-insensitive) gives nothing, whatever the data says. The defaults include Alex, Jordan, Kai, Jess, Marian, Ashley, Sam, Chris and Jamie, and short forms shared by both genders such as Jo, Mel and Pat. Since 3.30.2 it also has Elies, Tana and Tarun, which the dictionary reads as one gender but which were wrong or uncertain for Princes Park Touch contacts. This list always wins.
- Known names. Since 3.30.0 a name on the known list gets the gender listed there, without consulting the dictionary. It holds clearly gendered names the dictionary misses or hedges, such as Tilly and Rowan, drawn from Princes Park Touch’s members and contacts (lh-tasks #155750). Rowan moved here from the ambiguous list.
- Strict global reading. Otherwise the bundled
tuqqu/gender-detectorlibrary (the nam_dict data used by Python’s gender-guesser) must read the name as strictly Male or Female. Mostly male, mostly female, unisex and unknown names give nothing. - Nothing reads it the other way. The detector must give the same answer for every check country, GB and US by default. 3.30.0 dropped this check; 3.30.1 restored it, because without it half-known names such as Jann and Laurie were given a gender. A clear name the check drops goes on the known list rather than loosening the check.
- Several words. The whole value is looked up first (the data has compound names such as Anne-Marie); if it is unknown, the first word is used. Both are checked against the ambiguous and known lists.
What it never does
- It never suggests Organisation or Robot. Whether an account belongs to an organisation comes from the account itself, such as an organisational mailbox, never from a name.
- It never writes anything. Callers decide whether to store a suggestion in
lh_profile-gender, and should only fill an empty gender, never overwrite one a member or admin has set. - It doesn’t know about one person’s record. A decision to leave a particular account’s gender blank is not recorded yet (lh-tasks #155769), so a fill-only caller can still fill it.
Customising
There are no admin settings. The lists are static methods with filterable defaults, so a site plugin can adjust them for its own members:
lh_profile_return_ambiguous_first_namesfiltersreturn_ambiguous_first_names(): an array of names that never get a suggestion.lh_profile_return_known_first_namesfiltersreturn_known_first_names()(3.30.0+): an array of name =>'Male'or'Female'. Only common, clearly gendered names belong here; a name that was right for one person (a Chris or a Kelly) does not.lh_profile_return_gender_check_countriesfiltersreturn_check_countries(): ISO 3166 codes whose reading must agree with the global one (defaultGB,US). The detector reads AU and CA as its US column, and codes it does not know as its “other countries” column.
Performance
The detector parses its whole dictionary when it is created, which takes noticeable time and memory. The helper creates it only on first use and reuses it for the rest of the request, so batch callers should make all their lookups in one request rather than one per request. A name on the ambiguous or known list never loads the detector. If the library cannot be loaded, the helper logs an error and returns ''.

