I recently locked myself out of my WordPress site while experimenting with the Google Authenticator two-factor plugin. The fix is to disable the plugin over FTP, log in, and then turn it back on.
Steps to Disable the Plugin and Log In
- Connect to your site with an FTP or SFTP client and open
/wp-content/plugins/google-authenticator. - Rename the folder from
google-authenticatorto_google-authenticator. WordPress can no longer find it, so the plugin is disabled. - Log in to WordPress as normal and open the Plugins page.
- Back in FTP, rename
_google-authenticatorback togoogle-authenticator. - Refresh the Plugins page. The plugin now shows as deactivated. Reactivate it and reconfigure it in your user profile.
Avoid Locking Yourself Out Next Time
Before you enable two-factor authentication, create a second admin account without it. Test everything with your main account, and once it all works, delete the backup admin account. There’s a helpful video walkthrough of this approach here (video 3 on the page): Installation Essentials for WordPress.
