Category: WordPress

The default WordPress the password expiration is 24h which generally should be plenty of time.
You may run into cases where you or your clients may need a short or a longer period than the default expiration.

To modify the WordPress password expiration you need a code that hooks into password_reset_expiration and override it.

You can put this code into a custom plugin OR in functions.php of your current (hopefully a child) theme.

If you want to reduce the expiration time use this:

// How to reduce the password expiration to 8h
add_filter( 'password_reset_expiration', function( $expiration ) {
return 8 * HOUR_IN_SECONDS;
});

If you want to increase the time use this

// How to increase the password expiration to 48h
add_filter( 'password_reset_expiration', function( $expiration ) {
return 2 * DAY_IN_SECONDS;
});

 

For the expiration value you can use seconds or one of the WordPress time constants

https://codex.wordpress.org/Easier_Expression_of_Time_Constants

Join our mailing list

Get important news about cool products we release and invitations to beta test new products
We're working on a secure & flexible WordPress hosting solution. Read for more info (has 1min video)