Send reset password links in WordPress 5.7

WordPress 5.7 introduces a new feature that allows website administrators to manually send a reset password link to existing users. This can be helpful when users lose their password and cannot use the lost password link for any reason.

In terms of workflow, the feature does not directly change the user’s password. It sends them a password reset link via email so they are able to reset their password by themselves. Sending a reset password link is more secure than directly changing the password for the user. Passwords should not be communicated directly.

The reset password email notification is sent using the existing retrieve_password() function, which can be filtered using the retrieve_password hook. Please note that retrieve_password was also moved from wp-login.php to wp-includes/user.php.

This feature can be found in several places in the WordPress Adminadmin (and super admin).

Using the user profile screen

The feature is available on the user profile screen, right above the “Set new password” setting.

Using the action link available on the users list screen

There is also a quick action link available in the users list. It is showed when you hover/focus the user’s row.

Using bulk actions

It is also possible to bulk send password reset links by using the bulk action available in the action dropdown located right above the users list table.

Password reset link email notification

Here is the content of the email notification:

Subject: [SITENAME] Password Reset
- - -

Someone has requested a password reset for the following account:

Site Name: [SITENAME]

Username: [USERNAME]

If this was a mistake, ignore this email and nothing will happen.

To reset your password, visit the following address:

[RESET_PASSWORD_URL]

This password reset request originated from the IP address [IPADDRESS].

The email subject and message can be filtered using the retrieve_password_title and the retrieve_password_message hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same..


For reference, see ticketticket Created for both bug reports and feature development on the bug tracker. #34281

Props to @chaton666 and @jdy68 for proofreading

#5-7, #dev-notes