WordPress filter hook · part of WordPress core

lostpassword_errors

A WordPress core filter that 9 plugins also fire themselves, running on 54K+ sites between them.

“Filters the errors encountered on a password reset request.”

How to use lostpassword_errors

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'lostpassword_errors', function( $errors, $user ) {
	// Change $errors here.
	return $errors;
}, 10, 2 );

Argument names come from Fluent Support's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

9 plugins that fire lostpassword_errors

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Login & Register Customizer icon Login & Register Customizer30,000+ installs apply_filters( 'lostpassword_errors', $errors, $user_data ) includes/class-xoo-el-form-handler.php:921
  2. FluentAuth icon FluentAuth10,000+ installs apply_filters( 'lostpassword_errors', $errors, $user_data ) app/Hooks/Handlers/CustomAuthHandler.php:1093
  3. Fluent Support icon Fluent Support10,000+ installs apply_filters( 'lostpassword_errors', $errors, $user ) app/Modules/Auth/AuthController.php:337
  4. Easy Post Submission icon Easy Post Submission4,000+ installs apply_filters( 'lostpassword_errors', $this->errors, null ) includes/account-shortcodes.php:556
  5. BoxCart icon BoxCart50+ installs apply_filters( 'lostpassword_errors', $errors, $user ) includes/frontend/class-boxcart-account.php:1723
  6. User Registration & Login icon User Registration & Login50+ installs apply_filters( 'lostpassword_errors', $errors, $candidate ) includes/class-sav-frontend.php:3638
  7. Easy Membership and Magazine icon Easy Membership and MagazineFewer than 10 installs apply_filters( 'lostpassword_errors', $errors, $user_data ) template/forgot-password.php:145
  8. Dolphy icon DolphyFewer than 10 installs apply_filters( 'lostpassword_errors', $errors, $user ) hooks/ajax/access.php:72
  9. Safety Passwords icon Safety PasswordsFewer than 10 installs apply_filters( 'lostpassword_errors', $errors, $user ) src/Controller.php:300

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.