Skip to content

WordPress two-factor plugins compared: Two Factor, WP 2FA, Wordfence, miniOrange

A head-to-head comparison of WordPress 2FA plugins on the axes an operator actually decides on: supported factors, enforcement by role, what happens to XML-RPC and application passwords, recovery when an admin loses a device, and fleet maintenance.

For a site you maintain yourself, the core-team Two Factor plugin is the correct default: TOTP and backup codes, no licence, no external service, and enrollment stored in wp_usermeta so you can audit it with one query. For a fleet where somebody will ask you to prove enforcement, WP 2FA earns its place because policies by role with a grace period are a first-class feature instead of a filter you wrote. If Wordfence is already installed, use its Login Security module and do not add a second plugin — it is also the only option here that does something about XML-RPC. miniOrange is for the case where you need a factor nobody else offers and you have read carefully which methods the free build actually includes. And an identity proxy such as Cloudflare Access in front of wp-login.php is the only approach that covers doors a login-form plugin never sees. That last point is the one most comparisons skip: two-factor authentication on the login form does nothing at all for XML-RPC or for application passwords on the REST API.

What you’ll accomplish

  • Choose a 2FA approach from the axes that decide it in production, not from a feature grid.
  • Understand exactly which authentication paths a login-form plugin covers and which it leaves untouched.
  • Roll the choice out by role with a grace period, without locking anyone out on a Friday afternoon.
  • Close the XML-RPC and application-password side doors that 2FA does not reach.
  • Have a written, tested recovery path for the administrator who loses their phone.

Prerequisites

  • WordPress 6.4 or newer on PHP 8.1+, single site or multisite.
  • WP-CLI 2.9 or newer on the server, plus SSH or cPanel Terminal access. Everything here that matters happens outside the dashboard.
  • Database access through wp db query or phpMyAdmin as a last-resort recovery path.
  • A staging copy of the site. Enforcement changes are the sort you test somewhere you can afford to break.
  • An honest account inventory. If you do not know who holds an administrator account, that is the first problem, not the plugin choice.

If you have never enabled 2FA on a WordPress install, start with enabling 2FA on a WordPress admin account and come back here for the comparison. If you already know which plugin you want and need the deployment sequence, the 2FA rollout runbook covers that ground.

How it works

A WordPress 2FA plugin hooks the authenticate filter and the wp_login action. Username and password are validated first; if they pass, the plugin interrupts the request before the auth cookie is written and renders a second-factor screen. That is the entire mechanism, and it explains the limits.

The interruption only works where there is a page to interrupt. wp-login.php has one. XML-RPC does not: a client sends the username and password inside every request body and expects an XML response, so there is nowhere to show a code prompt. The same is true of the REST API when a request authenticates with an application password — the credential arrives in an Authorization: Basic header, WordPress validates it, and no login form is involved. The REST API authentication documentation describes this path directly: application passwords exist so that machine clients can skip the interactive login, which is useful and also means they skip your second factor.

Map of WordPress authentication doors showing which ones a login-form 2FA plugin covers and which stay open

Two things follow. First, any claim that a site “has 2FA” is a claim about wp-login.php and nothing else unless you did additional work. Second, the only layer that can cover several doors at once sits in front of PHP: an identity proxy or VPN that authenticates the request at the edge, before WordPress is reached at all. That is why Cloudflare Access belongs in this comparison even though it is not a plugin.

The factor itself matters too. TOTP is a shared secret plus a clock, and it resists password reuse and credential stuffing but not a convincing phishing page that relays the code in real time. WebAuthn and passkeys bind the credential to the site origin, which is what makes them phishing-resistant. Email codes are only as strong as the mailbox and depend on the site being able to send mail at all. SMS is the weak one: SIM-swap fraud and carrier-level interception are documented, routine attacks, and NIST has restricted SMS as an out-of-band authenticator in its digital identity guidance. Use SMS only when the alternative is no second factor.

Step-by-step

1. Inventory the accounts and roles before you touch a plugin

Enforcement is a decision about people. Get the list first.

wp user list --fields=ID,user_login,user_email,roles --format=table
wp user list --role=administrator --format=count

Expected output is a table of every account and a count of administrators. On a site nobody has audited, that count is usually higher than the owner believes — old agency accounts, a developer who left, a “backup admin” created during a migration. Deal with those now. A second factor on an account that should not exist is not a control.

2. Pick the factor set and the plugin

This is the comparison that actually decides it. Verify the current feature split on the version you install; free-tier boundaries move between releases.

OptionFactors in the free buildEnforcement by role and grace periodXML-RPC and application passwordsLicensing and upkeep
Two Factor (core feature plugin)TOTP, email codes, backup codesNot in the UI; you add a filter or an mu-pluginUntouched by the pluginFree, no paid tier, no external calls
WP 2FATOTP, email codes, backup codesPolicies by role with a configurable grace periodUntouched by the pluginFree tier plus a paid tier gating extra policy options
Wordfence Login SecurityTOTP, recovery codesRequired per role from the settings screenCan block XML-RPC logins, or accept the TOTP code appended to the passwordFree standalone plugin
miniOrange 2FATOTP in the free build; the wider method catalogue is gatedGated behind a paid tierUntouched by the pluginFree tier plus paid tiers; some methods need an account with the vendor
Suite 2FA (Solid Security, full Wordfence)Whatever the suite ships in the tier you runSuite settingsWordfence as above; otherwise untouchedFollows the suite licence
Identity proxy (Cloudflare Access, VPN)Whatever your identity provider offers, including passkeysPer path and per group, outside WordPressCovers any path you route through itFollows the provider plan; adds an operational dependency

Two things to weigh beyond the grid. Logging: Two Factor writes no audit trail of its own, Wordfence records login events in its own console, and WP 2FA comes from the same authors as a separate activity-log plugin that captures 2FA events. If somebody will audit you, decide where that record lives before rollout. Multisite: user meta is network-wide, so a user who enrolls once is enrolled everywhere, but the enforcement settings usually are not — network-activate and check the policy applies on a subsite, not just the main site.

Decision tree matching each operating scenario to a WordPress 2FA approach

3. Pilot on one administrator account, on staging

Install and enroll a single account that is not the only administrator on the site. The Two Factor plugin is the one used below because it is the lowest-variance choice for a pilot.

wp plugin install two-factor --activate
wp plugin list --name=two-factor --fields=name,status,version

Expected output shows two-factor with status active. Enroll from Users → Profile, scan the TOTP QR code, and confirm the enrollment landed:

wp user meta list <admin_login> | grep two_factor

Expected output includes _two_factor_enabled_providers and _two_factor_provider. If grep returns nothing, the profile save did not take — usually a caching plugin serving a stale profile page.

4. Enforce by role, with a grace period

Enforce on administrator and editor first. Leave subscriber and customer alone unless you have a specific reason. With WP 2FA, this is a policy screen with a grace period in days. With the Two Factor plugin, there is no enforcement UI, so you add one as an mu-plugin:

<?php
// mu-plugins/2fa-enforcement.php
// Redirect privileged users who have not enrolled to their profile page.
add_action( 'admin_init', function () {
	if ( ! class_exists( 'Two_Factor_Core' ) || wp_doing_ajax() ) {
		return;
	}
	$user = wp_get_current_user();
	if ( ! $user || ! array_intersect( array( 'administrator', 'editor' ), (array) $user->roles ) ) {
		return;
	}
	if ( Two_Factor_Core::is_user_using_two_factor( $user->ID ) ) {
		return;
	}
	if ( ! in_array( $GLOBALS['pagenow'], array( 'profile.php', 'admin-ajax.php' ), true ) ) {
		wp_safe_redirect( admin_url( 'profile.php#two-factor-options' ) );
		exit;
	}
} );

Success signal: an unenrolled editor who logs in lands on their profile page instead of the dashboard. Announce the grace period before you deploy this, not after.

5. Distribute and record backup codes

Every enrolled account generates backup codes at enrollment and stores them somewhere that is not the phone holding the authenticator. For client sites, that is your password manager under the site’s entry. Confirm codes exist:

wp user meta list <admin_login> --format=table | grep backup

Expected output shows a backup-codes meta row with a hashed value. Nothing readable — that is correct, the plugin stores hashes. If the row is missing, the user skipped code generation and one lost phone will cost you a database edit.

6. Close the XML-RPC and application-password doors

This step is what separates a real rollout from a checkbox. Start by seeing what application passwords already exist:

wp user application-password list <admin_login> --fields=uuid,name,created,last_used

Expected output is a table, often empty, sometimes containing a forgotten integration from a migration two years ago. Revoke anything you cannot account for:

wp user application-password delete <admin_login> --all

Expected output: Success: Deleted all application passwords. Then restrict both doors in an mu-plugin:

<?php
// mu-plugins/close-side-doors.php
// XML-RPC methods that require authentication stop working entirely.
add_filter( 'xmlrpc_enabled', '__return_false' );

// Application passwords stay available only to accounts that genuinely need them.
add_filter( 'wp_is_application_passwords_available_for_user', function ( $available, $user ) {
	$allowed = array( 'integrations-bot' );
	return in_array( $user->user_login, $allowed, true );
}, 10, 2 );

If XML-RPC is genuinely in use — the WordPress mobile app, an older Jetpack setup — do not disable it blindly. Restrict it by IP at the web server instead, or use the Wordfence option that requires the TOTP code appended to the password. Disabling or restricting XML-RPC covers the variants in detail.

7. Write the recovery procedure down before you need it

The procedure is three lines and it belongs in the client’s runbook, not in your head. It is in the Troubleshooting section below. Test it once on staging so you know the commands work on this particular install.

Validate it works

Verify all three doors, not just the one with the pretty screen.

The login form. Open a private browser window, sign in as the enrolled account, and confirm the second-factor screen appears before the dashboard. Then consume one backup code and confirm it is rejected on a second attempt — codes are single-use, and a code that works twice means the plugin is not saving state.

The REST API with an application password. Before step 6, this call succeeded with no second factor:

curl -s -o /dev/null -w '%{http_code}\n' \
  -u '<admin_login>:<application password>' \
  https://example.com/wp-json/wp/v2/users/me

Expected output after the restriction is in place: 401. Before it, 200 — which is the whole point, and worth running once in that order so you have seen it with your own eyes.

XML-RPC. Ask for a method that requires authentication:

curl -s https://example.com/xmlrpc.php \
  -H 'Content-Type: text/xml' \
  --data '<methodCall><methodName>wp.getUsersBlogs</methodName></methodCall>'

Expected output contains faultCode 405 and the string XML-RPC services are disabled on this site. A response listing blogs, or a plain authentication failure, means the filter is not loading.

Fleet-wide. Across many sites, the enrollment check is one loop and its output is your audit artifact:

wp user list --role=administrator --field=ID --format=csv | while read -r uid; do
  printf '%s\t%s\n' "$uid" \
    "$(wp user meta get "$uid" _two_factor_enabled_providers --format=json 2>/dev/null || echo 'NONE')"
done

Expected output: one line per administrator, with NONE marking anyone still unenrolled.

Troubleshooting

An administrator lost their device and is locked out. With WP-CLI, delete the enrollment meta and let them re-enroll:

wp user meta list <admin_login> | grep two_factor
wp user meta delete <admin_login> _two_factor_enabled_providers
wp user meta delete <admin_login> _two_factor_provider

Expected output: Success: Deleted custom field. for each. Without WP-CLI, do it in SQL:

DELETE FROM wp_usermeta
WHERE user_id = (SELECT ID FROM wp_users WHERE user_login = 'admin')
  AND meta_key LIKE '_two_factor%';

With neither, deactivate the plugin over SFTP by renaming its directory in wp-content/plugins, or run wp plugin deactivate two-factor. Re-enroll immediately afterwards. For plugins that store secrets in their own tables rather than user meta — Wordfence Login Security among them — deactivating the plugin is the supported recovery path; the enrollment is discarded and the user starts again.

TOTP codes are rejected even though they look right. Almost always clock drift on the server, not on the phone. Check it:

timedatectl status

Expected output includes System clock synchronized: yes and NTP service: active. If not, start chronyd or systemd-timesyncd. A server thirty seconds off rejects perfectly valid codes.

Customers cannot complete checkout, or the front-end login form skips the second factor. WooCommerce My Account and most membership plugins render their own login form. Some 2FA plugins hand that off to wp-login.php for the second step, some do not, and the result ranges from an extra redirect to a form that silently authenticates without the factor. Test the actual customer path on staging before enforcing anything on the customer role, and prefer enforcing on staff roles only.

Email codes never arrive. The site cannot send mail — the usual state of a WordPress install without a configured SMTP transport. Fix mail delivery first, and do not leave email as anyone’s only factor: it puts account recovery on the same footing as a mailbox you do not control.

Enforcement applies on the main site but not on a subsite. Network-activate the plugin and check the policy scope. On multisite, enrollment follows the user network-wide because wp_usermeta is shared, but a per-site enforcement setting does not.

When this is the wrong approach

2FA is a control against stolen and reused credentials. It is not a general security measure, and reaching for it first is common misallocation.

If the real risk is an unpatched plugin with a known vulnerability, 2FA changes nothing — an unauthenticated exploit never visits the login form. Patch cadence and restricting unauthenticated REST access matter more on that site than the factor you picked.

If administrators share one account and one password, 2FA papers over the problem and makes attribution worse, because now several people pass through the same second factor. Split the accounts first.

If the admin surface should not face the public internet at all — an internal site, a client portal, a staging environment — put it behind an identity proxy or a VPN and treat plugin-level 2FA as a second layer rather than the control. That is a stronger posture and it removes the lockout-recovery problem from your on-call rotation.

And on a store with thousands of low-value customer accounts, mandatory customer 2FA usually costs more in support load and abandoned checkouts than it removes in risk. Enforce on staff, offer it to customers, and spend the effort on the accounts that can actually change something.

Running WordPress that earns real money deserves an operator — Stack Harbor runs that stack under Enterprise WordPress; book an infrastructure consult.