Two-factor authentication (2FA) adds a second check to your WordPress login. As well as your password, you type in a six-digit code from an app on your phone. If someone guesses or steals your password, it isn’t enough to get them into your site.
I’ll fit the two-factor plugin that best suits your site. My go-to is Two Factor, the plugin from WordPress.org contributors, so that’s the one this guide walks through. If your site uses a different 2FA plugin, the steps are similar, and you can always ask me if you get stuck.
What is 2FA?
Most logins only check one thing: something you know, your password. 2FA adds something you have, usually your phone. To get in, you need both.
The code on your phone changes every 30 seconds, so even if someone sees one, it’s useless to them a minute later. I’ve written more about why 2FA matters if you’d like the background.
Before you start
You’ll need:
- To be logged in to WordPress.
- The 2FA plugin installed on your site. If I look after your site and you’d like it added, just ask.
- Your phone, with an authenticator app on it (see below).
Step 1: get an authenticator app
An authenticator app generates your login codes. Any of the well-known ones will do, and they’re free:
- Google Authenticator for iPhone or Android
- Microsoft Authenticator for iPhone and Android
If you already use a password manager such as 1Password, it can often store 2FA codes as well, so check before you install anything new.
Step 2: turn on 2FA in WordPress
- In your WordPress dashboard, go to Users > Profile.
- Scroll down to the Two-Factor Options section.
- Tick Enable Authenticator App. A QR code appears.
- Open your authenticator app, add a new account and scan the QR code with your phone’s camera.
- The app will show a six-digit code. Type it into the Authentication Code box and click Verify.
- Under Primary Method, choose Authenticator App.
- Click Update Profile at the bottom of the page.
That’s it. Next time you log in, WordPress will ask for a code from the app after your password.
Step 3: save your recovery codes
Recovery codes (sometimes called backup codes) are your way back in if you lose or replace your phone. Please don’t skip this bit.
- In the same Two-Factor Options section, tick Enable Recovery Codes.
- Click Generate new recovery codes. You’ll get 10, and each one works once.
- Click Download Codes or Copy Codes, then click Update Profile.
WordPress only shows the codes once, so store them somewhere safe straight away: a password manager is ideal, or print them and keep them with your important papers. Don’t keep them in an email or a note on the same phone as your authenticator app.
Email codes as a fallback
You can also tick Enable Email. WordPress will then be able to send a login code to the email address on your profile.
It’s handy as a backup, but it’s less secure than the app: if someone got into your email, they’d have the code too. So I’d keep the authenticator app as your primary method and use email only as a fallback.
If you’re locked out
It happens: a new phone, a lost phone, an app that’s been deleted.
- If you have your recovery codes, choose the option to use a recovery code on the login screen and type one in. Then set up the app again on your new phone and generate a fresh set of codes.
- If you don’t, another administrator on your site can turn 2FA off for your account from Users > All Users. If there isn’t one, or it’s you, send me a support request and I’ll get you back in. I reply within one working day.
Once you’re back in, set up 2FA again straight away.