WordPress filter hook · part of WordPress core
authenticate
A WordPress core filter that 34 plugins also fire themselves, running on 2.4M+ sites between them.
“Filter user authentication before setting auth cookies. Allows multisite spam-user checks and lockout plugins hooked to 'authenticate' to run.”
How to use authenticate
It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'authenticate', function( $value, $username, $password ) {
// Change $value here.
return $value;
}, 10, 3 );Argument names come from miniOrange 2FA'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 →
34 plugins that fire authenticate
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Limit Login Attempts Security1+ million installs
apply_filters( 'authenticate', null, $log, $pwd )core/integrations/MemberPressIntegration.php:257 -
Loginizer1+ million installs
do_action( 'authenticate', $user, $user->user_login, '' )main/social-base.php:23 -
Ultimate Member200,000+ installs
apply_filters( 'authenticate', null, $authenticate, $submitted_data['user_password'] )includes/core/um-actions-login.php:64 -
Nextend Social Login and Register200,000+ installs
apply_filters( 'authenticate', $user, $user->get('user_login'), '' )includes/user.php:559 -
miniOrange 2FA10,000+ installs
apply_filters( 'authenticate', null, $username, $password )controllers/class-wpns-ajax.php:148 -
Security Ninja7,000+ installs
apply_filters( 'authenticate', null, $username, $password )class-wf-sn-tests.php:2053 -
Log in with Google6,000+ installs
apply_filters( 'authenticate', $wp_user, $wp_user->user_login, '' )src/Modules/OneTapLogin.php:272 -
bbp style pack6,000+ installs
apply_filters( 'authenticate', null, $username, $password )bbp-style-pack.php:333 -
Plugin Detective5,000+ installs
apply_filters( 'authenticate', null, $username, $password )troubleshoot/includes/class-auth.php:64 -
BetterShield1,000+ installs
apply_filters( 'authenticate', $user, $user->user_login, '' )src/TwoFactor/Manager.php:760 -
Login with Vipps and MobilePay900+ installs
apply_filters( 'authenticate', $user, '', '' )VippsLogin.class.php:1105 -
Sidebar Login Widget600+ installs
apply_filters( 'authenticate', null, $username, $password )tt-sidebar-login.php:316 -
Mythic Cerberus200+ installs
apply_filters( 'authenticate', null, $username, $password )mythic-cerberus.php:476 -
User Registration & Login50+ installs
apply_filters( 'authenticate', $user, $user->user_login, '' )includes/class-sav-frontend.php:3832 -
Advanced Members for ACF20+ installs
apply_filters( 'authenticate', null, $user_name, $user_password )core/actions/login.php:172 -
PostGate20+ installs
apply_filters( 'authenticate', $user, $user->user_login, '' )includes/auth/class-google-auth-handler.php:365 -
WP Smart Security20+ installs
apply_filters( 'authenticate', null, $username, $password )inc/auth.php:32 -
CM Registration20+ installs
apply_filters( 'authenticate', null, $login, $password )model/User.php:123 -
HonnyPotter10+ installs
apply_filters( 'authenticate', null, $username, $password )honnypotter.php:71 -
VA Simple Enhanced Security10+ installs
apply_filters( 'authenticate', null, $username, $password )incs/class-module-email-login.php:164 -
Secure Login10+ installs
apply_filters( 'authenticate', null, $username, $password )includes/authenticate.php:24 -
asVereinbase10+ installs
apply_filters( 'authenticate', null, $username, $password )public/user-login.php:458 -
Login Token10+ installs
apply_filters( 'authenticate', null, $username, $password )index.php:25 -
Anar Toolkit10+ installs
apply_filters( 'authenticate', $checked, $user->user_login, '' )src/Auth/UserService.php:358 -
Logliy10+ installs
apply_filters( 'authenticate', $user, $user->user_login, '' )logliy.php:162 -
Real Protection & Safegaurd OTPFewer than 10 installs
apply_filters( 'authenticate', null, $username, $password )lib/safeguard-authenticate.php:30 -
Pnscode Social Login and RegisterFewer than 10 installs
apply_filters( 'authenticate', $user_obj, $user_obj->user_login, '' )includes/class-pnscsolo-email-verification.php:125 -
Vokull Security CenterFewer than 10 installs
apply_filters( 'authenticate', $user, (string) $user->user_login, '' )includes/auth/class-two-factor-login.php:413 -
Qevix ShieldFewer than 10 installs
apply_filters( 'authenticate', null, '', '' )includes/auth/class-qevix-shield-2fa.php:773 -
LinxyPassFewer than 10 installs
apply_filters( 'authenticate', $user, $user->user_login, '' )includes/class-assets.php:91 -
Kudzu Social LoginFewer than 10 installs
apply_filters( 'authenticate', $user, $user->user_login, '' )includes/class-oauth.php:197 -
atshift MembersFewer than 10 installs
apply_filters( 'authenticate', get_userdata($result['user_id']), '', '' )includes/class-screens.php:100 -
atshift Freeform LoginFewer than 10 installs
apply_filters( 'authenticate', $user, $user->user_login, '' )includes/passkeys/class-atshift-freeform-login-passkey-rest.php:418 -
Keyless LoginFewer than 10 installs
apply_filters( 'authenticate', $user, $user_data->user_login, '' )includes/class-keylesswp-passkeys.php:339 -
WP PassportFewer than 10 installs
apply_filters( 'authenticate', null, $username, $password )wp-session.php:48
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.