wp_generate_password ( $length = 12, $special_chars = true, $extra_special_chars = false )
- (int) length Optional. The length of password to generate. Default 12.
- (bool) special_chars Optional. Whether to include standard special characters. Default true.
- (bool) extra_special_chars Optional. Whether to include other special characters. Used when generating secret keys and salts. Default false.
- (string) The random password.
- Introduced in WordPress: 2.5.0
- Deprecated in WordPress: —
Generates a random password drawn from the defined set of characters.Uses wp_rand() is used to create passwords with far less predictability
than similar native PHP functions like `rand()` or `mt_rand()`.