Site icon Impact Digital

How to Set Up Two-Factor Authentication on WordPress

WordPress login screen asking for a two-factor authentication code from a phone

This guide is for small business owners, bloggers and agency staff who log in to WordPress with nothing more than a username and password. You will see why a password alone is a weak lock, which second-step methods exist, how to set up the free Two-Factor plugin, and what to do if someone gets locked out. The plugin details below come from its WordPress.org page as it read when this article was written, so check the page for changes before you start.

Why a password alone is not enough

The WordPress documentation on two-step authentication calls passwords the weakest part of most online logins, because they can be guessed and may leak in server breaches. The same page describes true two-step authentication as using two of three factor types: something you know (a password), something you have (a phone or hardware key) and something you are (a biometric). In practice, most systems today combine a password with a device you hold.

WordPress’s guidance on brute force attacks describes them as automated, often botnet-driven attempts to guess username and password combinations, and notes that even failed attempts can overload a site. It recommends long, unique passwords stored in a password manager, and it recommends enabling 2FA for all administrators and other privileged users. It also states that WordPress core does not include 2FA (as of 2025), so it has to come from a plugin or an identity provider.

2FA does not replace the other basics. Keep core, themes and plugins updated, limit the number of administrator accounts and keep tested backups. Our guide to automatic off-site WordPress backups covers that last point.

The main 2FA methods compared

The Two-Factor plugin page lists the methods it supports and how it labels them. The table summarises them, plus passkeys, which the WordPress security documentation also recommends.

MethodWhat it isWhat the sources say
Authenticator app (TOTP)A time-based code from an app on your phone, set up by scanning a QR codeMarked “Recommended” in the plugin; works with apps such as Google Authenticator, Authy and 1Password
Backup codesTen one-time codes for emergenciesMarked “Recommended” in the plugin
Email codesA one-time code sent to the email address on the WordPress accountListed as an available method, without the “Recommended” label
Security keys and passkeysHardware keys or WebAuthn passkeysFIDO U2F support was removed from the plugin; the plugin FAQ points to a separate “Two-Factor Provider: WebAuthn” plugin

The WordPress documentation also mentions SMS codes and says SMS is not a secure channel, with smartphone apps and plugins presented as more secure alternatives. For most small sites, an authenticator app plus a stored set of backup codes is a sensible starting point. Email codes are easier but depend on the security of the mailbox, so protect that mailbox with its own 2FA.

For passkeys, the brute force page describes them as phishing-resistant, passwordless login and advises enrolling at least two authenticators per admin. Because the Two-Factor plugin does not include passkey support itself, check the WebAuthn add-on’s own page and reviews before relying on it.

Before you start

If your site is busy or customised, trying the plugin first on a copy is wise. See how to use a WordPress staging site before you update.

Step-by-step: set up the Two-Factor plugin

  1. In your dashboard, go to Plugins, then Add New Plugin, and search for “Two-Factor”. Choose the plugin published on WordPress.org (the page lists its author as WordPress.org with community contributors), then click Install Now and Activate.
  2. Go to Users, then Your Profile, and scroll to the Two-Factor Options section.
  3. Enable the authenticator app (TOTP) method. Scan the QR code with your app, then enter the code it shows to confirm. The exact on-screen wording may differ by plugin version.
  4. Enable backup codes and generate your set. The plugin page says it generates 10 one-time codes. Store them before you leave the page (see the next section).
  5. Choose your primary method, then click Update Profile.
  6. Open a private browser window, log in with your password and confirm that the second-step prompt appears and accepts your app code.

Administrators can also open Settings, then Two-Factor, to disable specific providers site-wide. For example, you might switch off methods you do not want staff to use. The plugin page says a “Dummy Method” exists for testing only and is available only when WP_DEBUG is enabled, so it should never appear on a live site.

Requiring 2FA for admins and editors

This is the point most guides skip. According to the plugin page, Two-Factor has no built-in way to require 2FA for all users or for specific roles, and native enforcement is a tracked feature request on GitHub. The page also says that on multisite the settings are per user, so a super admin cannot enforce 2FA from Network Admin.

In practice, that means enforcement is a process you run yourself:

Because each user manages their own Two-Factor settings, a user can also switch their methods off again. That is one more reason to review profiles regularly and limit who holds privileged roles.

Storing backup codes safely

Backup codes are your insurance if your phone is lost, broken or replaced. A few habits help:

What to do if you are locked out

  1. Use a backup code. If you saved your codes, enter one at the second-step prompt.
  2. Ask another administrator. The plugin page says that if all methods are lost, a site administrator must reset the account. The FAQ’s route is Users, then All Users, edit the user, untick the enabled methods and click Update User.
  3. Use WP-CLI, if you have server access. The FAQ describes wp two-factor disable --yes, which performs a full reset. Ask your host or developer if you are not comfortable on the command line.
  4. Set it up again. Once back in, re-enroll your authenticator and generate fresh backup codes.

The WordPress documentation also notes that people who leave their phone behind may be locked out, which is the main drawback of the approach. Having a second administrator is the simplest safeguard.

Common mistakes

Key takeaways

FAQ

Does WordPress have built-in two-factor authentication?

No. The WordPress brute force guidance states that core does not include 2FA as of 2025, so you add it through a plugin or an identity provider.

Is the Two-Factor plugin free?

It is listed in the WordPress.org plugin directory and is developed and supported by a community, with code hosted on GitHub. The page shows no paid tier.

Can I use a security key or passkey?

Not through the plugin itself. FIDO U2F support was removed, and the FAQ points to a separate “Two-Factor Provider: WebAuthn” plugin. WordPress’s guidance recommends passkeys and enrolling at least two authenticators per admin.

Which 2FA method should a small site choose?

The plugin marks authenticator app codes and backup codes as recommended; email codes are available but do not carry that label. Most small sites do well with an app and a stored set of backup codes.

Sources

Exit mobile version