Hide My WP Ghost
  • Features
    • All Features
    • Brute Force Protection
    • Limit Login Attempts
    • Website Activity Log
    • Website Security Check
    • Security Tweaks
    • Change Wp-Admin URL
  • Pricing
  • Help
  • My Account
  • Features
    • All Features
    • Brute Force Protection
    • Limit Login Attempts
    • Website Activity Log
    • Website Security Check
    • Security Tweaks
    • Change Wp-Admin URL
  • Pricing
  • Help
  • My Account
Buy Now
  • Home
  • Hide My WP Features
  • Two-Factor Authentication

Two-Factor Authentication

Moved

This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.

View on new site
Table of Contents
  • Why You Need 2FA
  • How to Enable 2FA in WP Ghost
    • Activate the 2FA Feature
    • Choose a 2FA Method
    • Configure Shared Settings
  • 2FA Code Method (Authenticator App)
    • Set Up 2FA Code
    • Generate Backup Codes
  • 2FA Email Code Method
    • Set Up 2FA Email Code
  • 2FA Passkey Method
    • Set Up Passkey 2FA
  • Monitor 2FA Logins
  • Troubleshooting
    • 2FA Code from Authenticator App Is Not Accepted
    • Email Code Is Not Arriving
    • Locked Out and Cannot Access 2FA
    • Passkey Not Working on a New Device
  • Frequently Asked Questions
    • Which 2FA method should I use?
    • What are backup codes and why are they important?
    • Is 2FA free in WP Ghost?
    • Does 2FA work with WooCommerce?
    • Can I translate 2FA messages?
    • Does WP Ghost modify WordPress core files?
  • Related Tutorials

Add two-factor authentication to your WordPress login with WP Ghost (formerly Hide My WP Ghost) using an authenticator app, email code, or passkey (Face ID, Touch ID, Windows Hello). 2FA is free in all versions of WP Ghost.

A stolen password is all it takes. Verizon’s 2025 Data Breach Investigations Report found that 22% of breaches began with credential abuse. Brute force attacks surged 130% in 2024 according to LLAR’s 2025 report. Even with brute force protection limiting login attempts, a leaked password from another breach can succeed on the first try.

Two-Factor Authentication (2FA) closes this gap. It requires a second verification step after the password, so a stolen password alone cannot grant access. WP Ghost supports three methods: authenticator app codes, email codes, and passkeys (biometric/hardware authentication). All three are free.

This tutorial covers the full WP Ghost > 2FA Login panel: activation, method selection, per-method setup, shared settings, and login monitoring.

Why You Need 2FA

Passwords alone are no longer sufficient. Even strong, unique passwords can be compromised through data breaches on other services, phishing attacks, or malware. 2FA adds a second layer that is independent of the password itself.

Without 2FAWith WP Ghost 2FA
Stolen password grants full accessPassword alone is useless without the second factor
Phishing attack captures credentialsPasskey method is immune to phishing by design
Brute force can succeed with a lucky guessSecond factor blocks access even after correct password
No visibility into login activity2FA Logins monitor tracks all authentication attempts

How to Enable 2FA in WP Ghost

Activate the 2FA Feature

Go to WP Ghost > Overview > Features and switch on 2FA. Click Start Feature Setup to open the 2FA settings.

WP Ghost Overview Features panel showing the 2FA toggle and Start Feature Setup button

Once activated, the 2FA panel is available at WP Ghost > 2FA Login in the main menu.

Go to WP Ghost > 2FA Login > Settings and switch on Use 2FA Authentication.

WP Ghost Use 2FA Authentication toggle in the 2FA Login Settings panel

Choose a 2FA Method

WP Ghost offers three 2FA methods. You can enforce a single method for all users, or enable User Choice so each user picks their preferred method from their profile.

2FA Code – a one-time code generated by an authenticator app (Google Authenticator, Authy, Microsoft Authenticator, or LastPass Authenticator). The code rotates every 30 seconds. Best for teams who are comfortable with authenticator apps.

Email Code – a one-time code sent to the user’s email address on each login. No app installation required. Depends on reliable email delivery from your WordPress site. Use an SMTP plugin like WP Mail SMTP so the codes reach the inbox.

Passkey – your device’s built-in security (Face ID, Touch ID, Windows Hello, Android biometrics, or a hardware security key like YubiKey) verifies your identity. No codes to type, no emails to wait for. One tap or glance and you are in. This is the most secure option because passkeys are phishing-resistant by design.

WP Ghost 2FA method selection showing Code, Email Code, and Passkey options

Configure Shared Settings

These settings apply to all 2FA methods. Find them at WP Ghost > 2FA Login > Settings.

Max Fail Attempts – how many times a user can enter an incorrect 2FA code before their IP is blocked. Default: 5.

Ban Duration – how long (in seconds) the IP is blocked after exceeding the max fail attempts. Default: 900 (15 minutes).

Failed Attempts Message – an alert shown to users when failed 2FA attempts occurred on their account. Uses {count} for the number of failed attempts and {time} for the duration since the last failure.

Lockout Message – the message shown instead of the login form when a user is locked out. Uses {time} for the remaining lockout duration.

Delete 2FA Data on Plugin Uninstall – removes all 2FA configuration and user data when WP Ghost is uninstalled.


2FA Code Method (Authenticator App)

The authenticator app generates a rotating one-time code that changes every 30 seconds. Users enter the current code on the login page after their password.

Set Up 2FA Code

In WP Ghost > 2FA Login > Settings, select 2FA Code and click Save. Then click Add Two-Factor Authentication.

WP Ghost Add Two-Factor Authentication button for the 2FA Code method

You will be taken to your User Profile where a QR code is displayed. Open your authenticator app and scan the QR code. If your app only supports manual entry, use the text version shown in Step 2 of the setup screen.

WP Ghost QR code and text key for authenticator app setup with Step 1 and Step 2 labels

After scanning, the app starts generating rotating codes. Enter the current code in the verification field and click Submit.

WP Ghost verification code entry field for authenticator app setup

Once verified, every login will require the current code from your authenticator app after your password.

WP Ghost login page showing the 2FA code entry field after password authentication

For detailed app-specific setup guides, see: Google Authenticator, Authy, Microsoft Authenticator, LastPass Authenticator.

Generate Backup Codes

After setup, generate backup codes immediately. These one-time-use recovery codes are your safety net if you lose access to your authenticator app. Click Generate Backup Codes, then Download Codes to save them. Store them in a password manager or a secure printed location. Click Finalize to complete the process.

WP Ghost backup codes generation and download screen for 2FA Code method

If you need to re-sync your authenticator app or start over, use the Reset Key option in your User Profile.


2FA Email Code Method

A unique one-time code is sent to the user’s email address on each login. No app installation required. The user enters the code on the login page to complete authentication.

Set Up 2FA Email Code

In WP Ghost > 2FA Login > Settings, select Email Code and click Save. Then click Add Two-Factor Authentication.

WP Ghost Add Two-Factor Authentication button for the Email Code method

You will be taken to your User Profile where you enter the email address for receiving authentication codes. Click Submit to complete the setup.

WP Ghost email address entry for 2FA Email Code setup in User Profile

Once configured, a unique code is sent to your email on every login attempt. Enter the code on the login page to confirm your identity.

WP Ghost login page showing the email verification code entry field

Email delivery required

This method depends on your WordPress site being able to send emails reliably. Install an SMTP plugin like WP Mail SMTP so the codes arrive. Without SMTP, codes may not reach users. Generate backup codes as a safety net.

After setup, generate backup codes the same way as the Code method. Click Generate Backup Codes, download them, and click Finalize. To change the email address later, use the Reset Email Address option in your User Profile.


2FA Passkey Method

Passkeys use your device’s built-in security to verify your identity. After entering your password, your device prompts you to authenticate with Face ID, Touch ID, Windows Hello, Android biometrics, or a hardware security key. One tap or glance and you are in. The entire second factor takes under 2 seconds.

Passkeys are the most secure 2FA option because they are phishing-resistant by design. The cryptographic challenge is bound to the specific domain, so your device will not authenticate against a fake login page even if it looks identical to yours. No shared secret is ever transmitted.

Set Up Passkey 2FA

In WP Ghost > 2FA Login > Settings, select Passkey and click Save. Then click Add Two-Factor Authentication.

You will be taken to your User Profile. Click Add Passkey. Your browser prompts you to create a passkey using Face ID, Touch ID, Windows Hello, or your device’s preferred authentication method. Confirm the prompt to complete setup.

You can add multiple passkeys from different devices. For example, register your laptop’s fingerprint reader and your phone’s Face ID. If one device is unavailable, the other still works.

Passkeys are supported on all major platforms: iPhone and iPad (Face ID, Touch ID), Android (fingerprint, face unlock), macOS (Touch ID), Windows (Windows Hello), Chrome, Safari, Firefox, Edge, and hardware keys like YubiKey. Password managers like 1Password, Bitwarden, and Dashlane can sync passkeys across devices.

For passkey setup in detail, see the Passkey 2FA in WP Ghost tutorial.


Monitor 2FA Logins

Track all 2FA authentication attempts from WP Ghost > 2FA Login > 2FA Logins.

WP Ghost 2FA Logins monitor showing email, last access, mode, and login method

The monitor shows the user’s email, the timestamp of the last access, whether the attempt succeeded or failed, and which 2FA method was used. Check this regularly to identify unusual activity. Repeated failed attempts from the same account may indicate a targeted attack.


Troubleshooting

2FA Code from Authenticator App Is Not Accepted

The most common cause is a time sync issue between your device and the server. Authenticator codes are time-based. If your device’s clock is off by more than 30 seconds, codes will be invalid. On your phone, enable automatic time sync in your system settings. If the problem persists, use the Reset Key option in your User Profile and re-scan the QR code.

Email Code Is Not Arriving

Your WordPress site is not sending emails reliably. Install and configure an SMTP plugin like WP Mail SMTP. Check your spam and junk folders. If you are locked out, use a backup code to log in, then fix email delivery.

Locked Out and Cannot Access 2FA

Use a backup code. If you did not generate backup codes, check the emergency disable guide, use the rollback settings, or add a constant in wp-config.php to disable WP Ghost temporarily. This removes the 2FA requirement so you can log in and reconfigure.

Passkey Not Working on a New Device

Passkeys are device-specific. A passkey created on your laptop does not automatically work on your phone unless you use a password manager that syncs passkeys (1Password, Bitwarden, iCloud Keychain). Add a separate passkey from each device you use, or use a syncing password manager. If you cannot authenticate on any device, use a backup code and register a new passkey from the authenticated session.


Frequently Asked Questions

Which 2FA method should I use?

Passkey is the most secure because it is phishing-resistant and the fastest to use. 2FA Code (authenticator app) is the most widely compatible and does not depend on email delivery. Email Code requires no app installation but depends on reliable email delivery. If you are unsure, start with 2FA Code or enable User Choice to let each person decide.

What are backup codes and why are they important?

Backup codes are one-time-use recovery codes that let you log in if you lose access to your authenticator app, email, or passkey device. Generate and download them during 2FA setup. Store them in a password manager or a secure printed location. Each code can only be used once.

Is 2FA free in WP Ghost?

Yes. All three 2FA methods (Code, Email, Passkey) are included in the free version of WP Ghost with no limitations.

Does 2FA work with WooCommerce?

2FA applies to the WordPress login form. If WooCommerce uses the standard WordPress login (which is the default), 2FA protects it. WP Ghost is fully compatible with WooCommerce.

Can I translate 2FA messages?

Yes. When WPML or Polylang is active, 2FA messages and button labels can be translated from the string translation panel in your translation plugin.

Does WP Ghost modify WordPress core files?

No. 2FA is added through WordPress hooks and filters. No core files are modified. Disabling the 2FA feature removes all 2FA requirements instantly.


Related Tutorials

Complete your login security system:

Setting Up 2FA with Mobile Apps – step-by-step guides for Google Authenticator, Authy, Microsoft Authenticator, and LastPass.

Passkey 2FA in WP Ghost – passkey setup with Face ID, Touch ID, and Windows Hello.

Temporary Logins – passwordless time-limited URLs for developers and clients.

Brute Force Attack Protection – protect login forms with reCAPTCHA and attempt limits.

Change and Hide the Login Path – move your login page to a custom URL.

Activate Security Tweaks – login page design and redirect configuration.

Website Security Check – run a complete security audit.

October 13, 2023

Category: Tags:

  • Previous
    How to Change the REST API Path and Secure WordPress APIs with WP Ghost
  • Next
    Set Up WordPress 2FA with Mobile Authenticator Apps - WP Ghost Guide
  • Installation & Setup
    • Download plugin
    • Activate Hide My WP Ghost
    • Setup in Safe Mode & Ghost Mode
  • Customize Paths
    • Change wp-admin Path
    • Change wp-login Path
    • Hide Language Switcher
    • Change Author Path
    • Change Lost Password Path
    • Change Register Path
    • Change Logout Path
    • Change Activation Path
    • Change admin-ajax.php Path
    • Change Paths in Ajax Calls
    • Change wp-content Path
    • Change wp-includes Path
    • Change uploads Path
    • Change comments Path
    • Change Plugins Path
    • Change Themes Path
    • Change Rest API Path
    • Hide RSD Endpoint
    • Disable XML-RPC access
    • Hide WordPress Common Paths
    • Hide WordPress Common Files
    • Add Security Headers for XSS
    • Firewall Against Script Injection
    • Block Theme Detectors
    • Remove Unsafe Headers
    • Disable Directory Browsing
  • Security Tweaks
    • Redirect Hidden Paths
    • Login Redirect URL
    • Logout Redirect URL
    • Change Paths For Logged Users
    • Change Paths In Cached Files
    • Change Relative to Absolute URLs
    • Change Paths in Sitemaps XML
    • Change Paths in Robots.txt
    • Hide Admin Toolbar
    • Hide WordPress Version
    • Hide HTML Comments
    • Hide IDs from META Tags
    • Hide WordPress Generator
    • Hide Emoji icons
    • Disable Embed scripts
    • Disable WLW Manifest scripts
    • Disable DB Debug in Frontent
    • Disable Right Click
    • Disable Copy-Paste
    • Disable Drag-Drop
    • Disable View-Source
    • Disable Inspect Element
    • Login Page Design
  • URL Mapping and Text Mapping
    • URL Mapping
    • Text Mapping
    • CDN URLs
    • Optimize CSS and JS files
  • Brute Force Attack Protection
    • Activate Brute Force Protection
    • Math Captcha Protection
    • Google reCaptcha V2
    • Google reCaptcha V3
    • Ban IP addresses
    • Whitelist IP addresses
    • Blocked IPs Report
  • Firewall and Geo Security
    • 8G Firewall
    • Geo Security
    • Country Blocking
    • Whitelist IPs
    • Whitelist Paths
    • Blacklist IPs
    • Block User Agents
    • Block Referrers
    • Block Hostname
  • Temporary Logins
    • Global Settings
    • Create Temporary User
    • Edit Temporary User
    • Lock/Unlock Temporary User
    • Delete Temporary User
    • Copy Temporary Login Link
  • Two Factor Authentication
    • Activate 2FA Feature
    • Setting up 2FA Code Scan
    • Setting up 2FA Email Code
    • 2FA Login Monitor
    • Magic Link Login
  • Security Threats Log
    • Activate Security Threats Log
    • Reading Threats Report
    • Responding to Threats
    • GEO Threat Map
  • User Events Log
    • Activate Users Events Log
    • Log User Roles
    • Check User Events Log
    • User Events Email Alerts
  • Website Security Check
    • Run a Website Security Check
    • All The Security Tasks
  • Advanced WP Security
    • Custom Safe URL Parameter
    • Must Use Plugin Loading
    • Priority & Normal & Late Loading
    • Late Loading
    • Add Rewrites in WP Rules Section
    • Clean Login Page
    • Email Notification
    • Preset Security Options

Get Protected

  • Pricing & Plans
  • Install Free Version
  • Free vs Premium
  • Free Security Check
  • One-Click Security Presets
  • Quick Setup Guide
  • Best Practice Settings

Top Features

  • Hide wp-admin & wp-login
  • 7G + 8G Firewall
  • Brute Force Protection
  • 2FA & Passkey Login
  • Country Blocking
  • Security Headers
  • Security Threats Log
  • Temporary Logins

Resources

  • Knowledge Base
  • FAQs
  • Best Practice Guide
  • Plugin Compatibility
  • Theme Compatibility
  • Why WP Ghost
  • WordPress Security
  • Changelog

Company

  • Contact Support
  • Affiliate Program
  • Agency White Label
  • Media Kit
  • Terms of Use
  • Privacy Policy
  • About Us
© 2016 - 2026 WP Ghost. All rights reserved. Powered by AISQ.
Hide My WP uses cookies on the website to give you the most relevant experience by remembering your preferences and repeat visits.
Ok Reject
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT