WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp set password

Contents

Description

Updates the user's password with a new encrypted one.

For integration with other applications, this function can be overwritten to instead use the other package password checking algorithm.

Usage

<?php wp_set_password$password$user_id ?>

Parameters

$password
(string) (required) The plaintext new user password
Default: None
$user_id
(integer) (required) User ID
Default: None

Returns

This function does not return a value.

Examples

Below is an example showing how to update a user's password

<?php
$user_id = 1;
$password = 'HelloWorld';
wp_set_password( $password, $user_id );
?>

Notes

Change Log

Since: 2.5

Source File

wp_set_password() is located in wp-includes/pluggable.php

Related

wp_hash_password(), wp_set_password()

See also index of Function Reference and index of Template Tags.