Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

No password resets by email for administrators

The “Lost your password?” link can’t be used to reset an administrator’s password. If an admin’s mailbox is ever hacked, the site isn’t.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Login
  • Tested with WordPress 7.1
PHP
<?php

add_filter(
	'allow_password_reset',
	static function ( $allow, $user_id ) {
		return user_can( $user_id, 'manage_options' ) ? false : $allow;
	},
	10,
	2
);

Good to know

An administrator who forgets their password needs another administrator, WP-CLI (wp user update) or the host to reset it.

In these packs

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.