Quite a few months back I had to get a new iPhone as the battery in the phone was swollen and had to be disposed. I had the Google Authenticator mobile app on my old phone and had quite a few sites set up within Google Authenticator. I had set up a WordPress site with two-factor authentication with a Google Authenticator plugin. When you do this, the admin login page will have not only username/password; but also a field to enter the one-time code that is generated from the Google Authenticator mobile app (like shown below):
The issue that I had was that my administrator login to WordPress was set up to use Google Authenticator. What is a person to do??? Well, turns out that the fix is quite an easy one. Details to resolve are listed below.
*Note*: Credit for these detailed instructions belong to Juan Monroy over at: https://juanomatic.net/2013/09/did-google-authenticator-lock-you-out-of-your-wordpress-org-account/
- Log in to your SSH or SFTP account with your hosting provider (alternatively, if your hosting provider offers a web-based folder navigation / admin tool, this will work just as well).
- Navigate to the wp-content directory.
- Create a directory called disabled or something else that won’t interfere with WordPress. This will be a temporary measure.
- Navigate to the wp-content/plugins directory.
- Rename (or move) the google-authenticator directory to the wp-content/disabled directory. Type something like…
mv google-authenticator ../disabled - On your web browser, load your wp-admin page. You’ll see that you will not be prompted for a Google Authenticator code.
- Using SSH or SFTP, move the google-authenticator directory back to the plugins directory. If you are still in the plugins folder, type something like…
mv ../disabled/google-authenticator . - Delete the disabled directory.
rm -rf disabled - With your web browser, go to your Dashboard and then to the Plugins area. Reactivate the Google Authenticator plugin.
- On your Profile page, scan the barcode to add this WordPress account to your Google Authenticator app.