wp_generate_password
wp_generate_password ( $length = 12, $special_chars = true, $extra_special_chars = false )
Parameters:- (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.
Returns:- (string) The random password.
Defined at: - Introduced in WordPress: 2.5.0
- Deprecated in WordPress: —
Description
Generates a random password drawn from the defined set of characters.Uses wp_rand() to create passwords with far less predictability
than similar native PHP functions like `rand()` or `mt_rand()`.