A single-site 2FA rollout for the admin role takes an afternoon. A fleet rollout — forty WordPress sites, twelve agencies, no consistent plugin baseline — is a different problem. The challenge is not the technical enforcement on any one site. It is producing a defensible “all admins have 2FA” statement to the security committee when the underlying plugins, identity sources, and admin user lists differ per site. The runbook below is for the fleet case: the plugin standardization decision, the enforcement deployment, and the audit query that proves the work.
What’s happening
A WordPress admin without 2FA is a credential-stuffing target. Across a fleet, the question is not “is 2FA enabled” but “is 2FA enforced on every administrator account on every site, and how do we know.” The honest answer requires three pieces:
- A single 2FA plugin choice deployed identically across the fleet. Mixing Wordfence, Solid Security, miniOrange, and the Two-Factor feature plugin per-site means every audit is bespoke.
- An enforcement mechanism that does not depend on the user choosing to enroll. Voluntary enrollment hits a ceiling around 40% even with strong comms.
- A fleet-wide read-only query that returns every admin without 2FA across every site, runnable by audit on demand.
Without all three, “we have 2FA” is a marketing statement, not a control.
How to verify
For one site at a time, the verification depends on the plugin. For the Two-Factor feature plugin (recommended baseline for fleets — no upsell, integrates with WP-CLI, uses the core user_meta table):
wp user list --role=administrator --field=ID --format=csv | while read uid; do
wp user meta get $uid _two_factor_enabled_providers --format=json 2>/dev/null | \
grep -q "Two_Factor_Totp" && echo "$uid: enrolled" || echo "$uid: NOT enrolled"
done
For Wordfence, the relevant table is wf2fasecrets:
wp db query "SELECT u.ID, u.user_login \
FROM wp_users u \
JOIN wp_usermeta um ON u.ID = um.user_id \
WHERE um.meta_key = 'wp_capabilities' AND um.meta_value LIKE '%administrator%' \
AND u.ID NOT IN (SELECT user_id FROM wf2fasecrets);"
Across a fleet, pipe these into a manifest run by your orchestrator (Ansible, a deployment-management tool, or wp @all if you use the WP-CLI alias file). Output is a CSV with site, user_id, user_login, enrollment_status. That CSV is your audit artifact.
The fix
The fleet rollout follows a sequence that does not change much site to site, but the orchestration does.
-
Standardize on one plugin. The Two-Factor feature plugin (
two-factor) is the right default for fleets: it does not phone home, has no paid tier to upsell, supports TOTP and email backup, and writes towp_usermetaso cross-site audit is one SQL query. Install via WP-CLI across the fleet:for site in $(cat sites.txt); do ssh deploy@$site "cd /var/www/html && wp plugin install two-factor --activate" done -
Enable enforcement at the plugin level for the administrator role. The Two-Factor plugin honors a filter that you set in a must-use plugin deployed via your config-management tool:
// mu-plugins/2fa-admin-enforce.php add_filter('two_factor_user_api_enforce', function ($enforce, $user) { return in_array('administrator', (array) $user->roles, true); }, 10, 2);With this filter, an administrator who has not enrolled gets a “you must enroll before accessing any admin page” redirect to their profile. Login itself still works — the redirect happens after authentication — so the admin can complete enrollment without help.
-
Application passwords for headless integrations. A migration tool, a CI deployer, a monitoring agent — these cannot do TOTP. Issue application passwords (built into core since 5.6) scoped narrowly, document them in a password manager, and rotate annually. Application passwords are not exempt from 2FA at the protocol level; they are a separate credential class that the user creates after they have 2FA enabled. That order matters.
-
The fleet audit query. This is the artifact for the security committee. Run it weekly, save the output, surface it on a dashboard:
-- For each site, count administrators without 2FA enrolled SELECT '{{site_id}}' AS site, u.ID, u.user_login, u.user_email FROM wp_users u JOIN wp_usermeta um1 ON u.ID = um1.user_id AND um1.meta_key = 'wp_capabilities' AND um1.meta_value LIKE '%administrator%' LEFT JOIN wp_usermeta um2 ON u.ID = um2.user_id AND um2.meta_key = '_two_factor_enabled_providers' WHERE um2.meta_value IS NULL OR um2.meta_value NOT LIKE '%Two_Factor_Totp%';Zero rows across the fleet is the goal. Any rows are either gaps or exceptions; the exceptions need a documented expiry. Anything else is a credential-stuffing target with administrator capability.
-
Recovery flow at the fleet level. The lost-device path cannot be “ask the agency that built the site three years ago.” Establish a designated platform admin team that holds the recovery process. The team verifies identity via a second channel (Slack DM, signed email from the contact-of-record), then issues a one-time login link via WP-CLI and immediately re-enrolls 2FA. Log every recovery to a shared file the auditor sees.
-
Plugin update discipline. A 2FA plugin that is silently disabled by a plugin conflict is worse than no plugin, because the fleet audit thinks everything is fine. Add a uptime check that hits
wp-login.php?action=verify_2faand asserts the expected challenge page. If it returns the normal login page, 2FA is not being enforced and the alert fires.
The fleet rollout is mostly orchestration work, not WordPress work. Stack Harbor runs this rollout across managed WordPress fleets under enterprise WordPress operations, including the audit query as a quarterly artifact and the recovery process owned by named admins. If you cannot answer “how many administrators have 2FA enabled across our WordPress fleet” in under five minutes, book a fleet audit.