Plugins Plugin hub Backup SEO Caching Security Forms WooCommerce Images Best backup plugins
Hosting Hosting directory Shared Managed Cloud India
Themes & builders Compare Rank Math vs Yoast
Tools All tools Hosting finder Plugin stack builder Cost calculator Salt generator Theme detector Who is hosting this? Speed test Headline analyzer robots.txt generator Redirect generator Uptime calculator Blog name generator
Best lists Best backup plugins Deals
Guides All guides Speed up WordPress Choose hosting Back up WordPress
How we test

Security · Guide

How to Add Two-Factor Authentication to WordPress

Short answer

To add two-factor authentication to WordPress, install the free Two Factor plugin or WP 2FA, open your user profile, enable the authenticator app method, scan the QR code with Google Authenticator or a similar app, and enter the 6-digit code to activate it. Save your backup codes before you log out, so you can get back in if you lose your phone.

Key takeaways

  • Two-factor authentication adds a 6-digit code from your phone after your password, so a stolen password alone is not enough.
  • The free Two Factor plugin offers app, email, and backup-code methods, with each user setting it up in their own profile.
  • WP 2FA adds a setup wizard, passkeys, and role enforcement with grace periods, and version 4.3.0 came out on 4 November 2026.
  • The standalone Wordfence Login Security plugin was closed permanently on 17 August 2026; use the full Wordfence plugin instead.
  • Save your backup codes before you log out, since they are your only way back in if you lose your phone.
  • Each TOTP code lasts only 30 seconds, and a wrong clock on your phone is the first thing to check when a code fails.

What is two-factor authentication in WordPress?

Two-factor authentication (2FA) asks for a second proof of identity after your password, usually a 6-digit code from an app on your phone.

A password alone is one factor: something you know. The code is a second factor: something you have. An attacker who steals your password still cannot log in without your phone.

The Two Factor plugin puts it plainly: 2FA protects against unauthorized access even if passwords are compromised. WordPress has no built-in 2FA, so you add it with a plugin (WordPress.org).

Which 2FA plugin should you choose?

Pick the plugin that matches how much control you need over other users.

PluginCostMethodsEnforce for rolesBest for
Two FactorFreeApp, email, backup codesNo, per-user onlyA single admin
WP 2FAFreeApp, email, backup codes, passkeysYes, with grace periodsTeams and stores
Wordfence SecurityFreeApp (TOTP), passkeysYesSites already running Wordfence
Solid SecurityFreeApp, backup codesYesSites already running Solid Security

The Two Factor plugin is the lightest option and is maintained by WordPress core contributors. WP 2FA adds role enforcement and a setup wizard, which matters when other people log in to your site.

If you already run Wordfence Security or Solid Security, use the 2FA built into that plugin instead of adding another one. Our Solid Security guide covers what that plugin includes.

How do you add 2FA with the Two Factor plugin?

Install the free Two Factor plugin, then set it up from your own user profile.

  1. Go to Plugins > Add New, search for “Two Factor”, then install and activate it.
  2. Go to Users > Your Profile and scroll to the Two-Factor Options section.
  3. Tick Authenticator App (TOTP) and scan the QR code with your authenticator app.
  4. Enter the 6-digit code from the app to confirm the link works.
  5. Tick Backup Codes, generate the 10 codes, and save them somewhere safe.
  6. Pick your primary method and click Update Profile.

Each user must set up 2FA on their own profile, and an admin can open any user's profile to help. The plugin's settings page under Settings > Two-Factor lets an admin hide methods site-wide.

The plugin supports the last two major WordPress versions and works on multisite, where each user's settings follow their account across the network.

How do you add 2FA with WP 2FA?

WP 2FA walks you through setup with a wizard, and it can require 2FA for other users.

  1. Go to Plugins > Add New, search for “WP 2FA”, then install and activate it.
  2. Follow the setup wizard to pick your method, usually the authenticator app.
  3. Scan the QR code with your authenticator app and enter the 6-digit code.
  4. Save the 16-digit backup codes the wizard shows you.
  5. Set a 2FA policy for other roles, with a grace period or instant activation.

The free version includes the authenticator app method and email codes, plus passkeys for passwordless logins. Premium adds SMS, YubiKey, and trusted devices (WordPress.org).

Version 4.3.0 was released on 4 November 2026, and the plugin holds a 4.7 out of 5 rating from 184 reviews. It is multisite compatible, and its policies can apply to all users, a set of roles, or one site on a network.

How do you set up the authenticator app?

Install an authenticator app on your phone before you start, such as Google Authenticator, Authy, Microsoft Authenticator, or 1Password.

Open the app, choose to add a new account, and scan the QR code shown on your WordPress screen. If you cannot scan it, type the setup key shown below the code into the app by hand.

The app then shows a 6-digit code for your site. Enter the current code into WordPress to confirm the link. Each code lasts only 30 seconds, so enter the one showing now, not one that just expired (MakeUseOf).

Google Authenticator can generate codes with no internet connection or mobile service, and it can sync codes across your devices when you sign in to your Google Account. It needs Android 6.0 or above, or iOS 4.0 or above (Google support).

How do you save backup codes and avoid getting locked out?

Save your backup codes before you finish setup, and keep them somewhere safe.

The Two Factor plugin generates 10 one-time backup codes, while WP 2FA uses 16-digit backup codes. Each code works once, and it is your way back in if you lose your phone.

Store the codes in your password manager or on paper in a safe place, not in a file on the same site. If you lose both your phone and your codes, only a site administrator can reset your 2FA from your user profile.

An admin can remove 2FA for a locked-out user by opening Users > All Users, editing the profile, and unchecking every enabled method. WP 2FA also lets you deactivate the plugin by hand, log in without 2FA, and set it up again.

How do you require 2FA for other users and roles?

Requiring 2FA depends on the plugin you picked, since the Two Factor plugin has no built-in enforcement.

With WP 2FA, set a policy for each role: administrators at least, plus editors and shop managers if they can publish or see orders. Give users a grace period to set it up, rather than locking them out on the first login.

With the Two Factor plugin, there is no enforcement setting in the interface. Developers can use its filters to control which providers are available per user, but most site owners who need enforcement should use WP 2FA or a security plugin instead.

Wordfence Security lets you require 2FA for roles from its Login Security settings, and Solid Security does the same from its own settings. Our WordPress security statistics guide shows why login attacks make this worth doing for every admin account.

What happened to Wordfence Login Security?

The standalone Wordfence Login Security plugin was closed permanently on 17 August 2026 and is no longer available for download.

If you already have it installed, it keeps working, but it will receive no updates. Move to the full Wordfence Security plugin instead, which includes 2FA through any TOTP-based authenticator app, plus passkeys, a login page CAPTCHA, and brute-force protection (WordPress.org).

WP 2FA version 4.2.1 added a migration guide in its setup wizard for sites moving away from Wordfence Login Security. It moves each user's 2FA setup and backup codes, so you do not need to ask everyone to scan a new QR code.

Do not install the closed plugin from a ZIP file found elsewhere. A plugin with no updates is a risk, and the two supported paths above cover the same job.

How do you check that 2FA works?

Log out and log back in from a private browser window, before you close your current session.

Enter your username and password, then the current 6-digit code from your app. If the code fails, check that the time on your phone is correct, since TOTP codes depend on the clock. Google's Authenticator help notes that a wrong device time is the first thing to check when a code does not work.

Then test your backup plan. Use one backup code to log in once, and confirm you can reach your profile. Replace the used code afterwards, since each backup code works only once.

What mistakes should you avoid?

The biggest mistake is setting up 2FA and then losing your only way back in.

  • Skipping the backup codes, or saving them on the same site you protect.
  • Setting up 2FA on only one admin account while other admins log in with a password alone.
  • Using email codes as your only method when your email and your site share the same password.
  • Turning on 2FA for every role at once with no grace period, which locks out users mid-task.
  • Installing two 2FA plugins at the same time, which can conflict at login.

2FA is one layer, not the whole job. WordPress's own security guide says the most important thing is to keep WordPress, plugins, and themes up to date (WordPress Developer Resources). Pair 2FA with strong passwords and the other basics in our security headers guide.

Frequently asked questions

What do I do if I lose my phone with 2FA on it?

Yes, if you still have your backup codes. Each code works once, so use one to log in, then generate a fresh set. If you have no backup codes, a site administrator must reset your 2FA from your user profile, or you can deactivate the plugin by hand through your host's file manager.

Does two-factor authentication slow down logging in?

No. 2FA adds about 10 seconds to a login: open the app, read the 6-digit code, and type it in. You only do this at login, and some plugins offer trusted devices so you are not asked every time.

Are email codes as safe as authenticator app codes?

Email codes are weaker than app codes, because anyone who can read your email can get the code. Use the authenticator app as your main method and keep email codes as a backup. Never use the same password for your email and your WordPress account.

Can I use 2FA with WooCommerce customer logins?

Yes, with the right plugin. WP 2FA includes a one-click WooCommerce integration in its premium version, and it can enforce 2FA for customers and store admins. The Two Factor plugin works on any login form that uses the standard WordPress login flow.

Should I use SMS codes for WordPress 2FA?

No. SMS codes can be intercepted, and Wordfence moved to authenticator apps for better security and reliability in version 7.3 and later. Use an authenticator app, and keep SMS out of your login flow.

Does 2FA work on WordPress multisite?

Yes. The Two Factor plugin works on multisite, and each user's settings follow their account across the network. WP 2FA is also multisite compatible and can enforce policies per site or across the whole network.

Sources

  1. Two Factor – WordPress plugin WordPress.org
  2. WP 2FA – Two-factor authentication for WordPress WordPress.org
  3. Wordfence Login Security (closed) WordPress.org
  4. Wordfence Security – Firewall, Malware Scan, and Login Security WordPress.org
  5. Get verification codes with Google Authenticator Google Support
  6. Security – Advanced Administration Handbook WordPress Developer Resources

Is your product missing, or something out of date?

Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.

About the editors

WPLegible editors

Researched from the primary sources listed above and checked against our editorial rules. About the site · How we test