Make "reset your password" links expire after one hour instead of WordPress's default of one day.
add_filter( 'password_reset_expiration', function (): int {
return HOUR_IN_SECONDS;
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
A password reset link is as good as a password until it expires. WordPress keeps them valid for 24 hours. If an inbox is compromised or an email is forwarded, a shorter window means less risk.
The password_reset_expiration filter sets how long reset keys stay valid, in seconds. Returning HOUR_IN_SECONDS means a link older than an hour shows “Your password reset link has expired” and the user requests a new one.
Request a password reset, wait just over an hour and open the link. You should see the expired message.