WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/generate random password


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Contents

Description

Generates a random password of the specified length (up to a maximum of 32 characters).

Replace With

Parameters

$len
(integer) (Optional) The length of the password to generate. Values over 32 will return a 32 character password.
Default: 8

Return values

(string) 
A random password of length $len.

Usage

<?php generate_random_password($len?>

Examples

<?php
  
echo 'Random password: '.generate_random_password( );
?>

Notes

This function executes the random_password filter after generating the password.

Change Log