New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

2FA

Learn how to enable WordPress two-factor authentication.

Two-factor authentication stops most password-guessing attacks even when credentials leak. This tutorial sets up TOTP apps like Google Authenticator or Authy for WordPress admin accounts using trusted plugins.

Time: 15-30 minutes Level: Beginner
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

What this problem looks like

Passwords alone fail against credential stuffing and phishing. TOTP two-factor adds a six-digit code from an app on your phone. Enforce 2FA on every account that can install plugins or edit users.

Test on your own admin account before enforcing site-wide. One misconfigured enforcement can lock out every administrator at once.

Step 1: Install a 2FA plugin

From wp-admin go to Plugins → Add New. Search for Two Factor by the WordPress Contributors or WP 2FA by Melapress. Install only from wordpress.org or known vendors.

  1. Install and activate the plugin.
  2. Open its settings page under Settings or Users.
  3. Confirm compatibility with your login customisation plugins.

Step 2: Set up TOTP on your admin account

Go to your user profile. Scan the QR code with Google Authenticator, Authy, or 1Password. Enter the six-digit code to confirm enrollment.

Step 3: Enforce 2FA for privileged roles

In plugin settings, require 2FA for Administrator and Editor roles. Give users a grace period to enroll before blocking login without a code.

Step 4: Test login on staging and production

Log out and log in with password plus TOTP code. Test from a private window. Confirm WooCommerce my-account login is unaffected if customers use a separate flow.

Step 5: Plan account recovery

Document who holds backup codes. If a phone is lost, rename the 2FA plugin folder in wp-content/plugins/ via File Manager, SFTP, or FTP to deactivate it temporarily. Rotate salts after recovery if compromise is suspected.

When to stop DIY and hire help

Agencies managing many client sites benefit from enforced 2FA and login hardening without lockout risk. BugShield configures WordPress security policies at a confirmed fixed price.

Questions answered

WordPress two-factor authentication FAQs

Answers about authenticator apps, role policies, backup codes, application passwords, and avoiding administrator lockout.

Does 2FA slow down editors?

Login takes a few extra seconds once per session. Remember device options reduce prompts on trusted computers.

Can I use SMS instead of an app?

TOTP apps are more secure than SMS. Avoid SMS 2FA unless no other option exists.

Will 2FA break REST API or webhooks?

Application passwords and API keys work separately from dashboard 2FA. Test integrations after enabling.

What if I am locked out?

Rename the 2FA plugin folder via File Manager, SFTP, or FTP to disable it, or use hosting file access to remove enforcement options from the database.

Which WordPress users should use two-factor authentication?

Require it first for administrators, shop managers, editors, support staff, and anyone who can install code, view customer data, or change billing settings.

Do I need a plugin for WordPress two-factor authentication?

Usually yes. Choose a maintained plugin that supports your required roles, recovery codes, enforcement windows, and login integrations.

Where should I store WordPress 2FA backup codes?

Keep them in an encrypted password manager or approved secure Vault, separate from the device running the authenticator app.

Can I enforce WordPress 2FA for administrators only?

Yes. Many 2FA plugins let you require it by role, then offer an enrolment period before access is blocked.

Does WordPress 2FA affect application passwords?

Application passwords authenticate integrations separately and may bypass the interactive 2FA prompt. Review, limit, and revoke any that are no longer required.

How do I recover access if I lose my WordPress 2FA device?

Use a stored backup code or another approved administrator recovery method. If neither exists, disable the 2FA plugin through hosting access and re-enrol immediately.

Would you rather a developer fixed it?

Request a fix at a confirmed price and speak directly with the BugShield developer working on your site.

Request a Fix