Protect admin account from being deleted or modified by other users. This plugin will always be hidden from all users other than the admin who installs it. Only users with administrator role can be protected.
This plugin might be useful if you want to share admin access with other users (like your tech guy or developers) but don’t want them to mess with your admin account. Or you could be the developer or tech guy who might need this plugin to prevent other non-technical admins from accidentally deleting or modifying your account.
How It Works
As soon as the plugin is activated, it will store the ID of the user that activated the plugin. The plugin will then be hidden from all users other than this user.
You can choose which admin account (yourself or others) to protect. Only the user who activates the plugin can save its settings. Other users won’t see the setting page or the menu.
Once the admin account to be protected is selected on the setting page, other users and admins will NOT be able to:
- delete the protected admin account.
- access the profile edit page for the protected admin account.
- change the role of the protected admin account.
- select the protected admin account in the bulk actions on users list page.
Additionally, if other users and admins, under unlikely circumstances, are able to access the user profile page of the protected admin account with the help of some other plugins, this plugin will prevent any modification to be saved.
Similarly as above, if other users or admins are able to change the protected admin account’s email address via the profile page, this plugin will revert it back to the original email address.
Once you deactivate the plugin, all users with the ability to manage plugins (
activate_plugins capability) will be able to see the plugin. It is advised to only deactivate the plugin when you feel safe to do so. Otherwise you can just enable or disable protection from the plugin setting page.
If you want to be extra cautious (depending on your needs), you should also manually disallow file edit. This plugin doesn’t do that because some people might still need it.
define( 'DISALLOW_FILE_EDIT', true );
This plugin has NOT been tested with other user management plugins or role editor plugins. Hence its use alongside these types of plugins is not guaranteed to work as intended.
- Upload plugin folder to
/wp-content/plugins/directory, or install the plugin from your WordPress dashboard
- Activate the plugin.
- Go to
Users>Protect Userto configure the plugin.