• Pricing
  • Help
  • My Account
  • Download
WP Ghost
  • Pricing
  • Help
  • My Account
  • Download

Two-Factor Authentication

/Features / Two Factor / Two-Factor Authentication
2FA Authentication
Table of Contents
  • What is Two-Factor Authentication (2FA) in WordPress?
  • Why is it Essential to use Two-Factor (2FA)?
  • How to Use Two-Factor with WP Ghost
    • Activate Two-Factor Authenticator Feature
  • 2FA Code Method
    • Activate 2FA Code
    • Setup 2FA Code
      • Max fail attempts
      • Ban duration
      • Failed Attempts Message
      • Lockout Message
      • Delete 2FA Data on Plugin Uninstall
    • Setup 2FA Code on User Account
      • Reset Key Option
    • Test 2FA Code
  • 2FA Email Code Method
    • Activate 2FA Email Code
    • Setup 2FA Email Code
      • Max fail attempts
      • Ban duration
      • Failed Attempts Message
      • Lockout Message
      • Delete 2FA Data on Plugin Uninstall
    • Setup 2FA Email Code on User Account
      • Reset Email Address Option
    • Test 2FA Email Code
  • Monitor 2FA Logins
  • Recommendations
  • Troubleshooting

With the WP Ghost plugin, you can activate 2FA to secure your website’s login path, adding an extra layer of protection to your admin dashboard. This feature ensures that even if a hacker gains access to your password, they won’t be able to log in without the second authentication factor.

Enabling 2FA through WP Ghost protects your website with a more resilient security framework, keeping your admin area secure from potential threats.

What is Two-Factor Authentication (2FA) in WordPress?

Two-Factor Authentication, or 2FA, is like adding a second lock to your door. When you log in to your website, you need more than just your password (the first lock). With 2FA, you also need a second key, like a code sent to your phone or email.

Even if someone steals your password, they can’t log in without the second key. This makes your website much harder for hackers to break into, keeping it safe and secure.

Two-factor authentication (2FA) helps you add an extra layer of security to your WordPress site by requiring both a password and an additional verification step to log in. This verification comes from something that only an authorized user can access, such as an email message or an app-generated code.

Here’s a deeper dive into why 2FA is a valuable addition to your security toolkit.

Why is it Essential to use Two-Factor (2FA)?

  • Strengthens Login Security: 2FA significantly increases security by introducing an additional level of protection. Even if a malicious entity obtains a password, they will still be unable to access the account without the second verification.
  • Curbs Password Vulnerabilities: Accidental password exposures or leaks are mitigated by 2FA. A potential breach requires more than just the password, making unauthorized access much more challenging.
  • Deters Cyber-attacks: Implementing 2FA reduces the appeal of your site to hackers. A double authentication mechanism presents an added hurdle for malicious entities, discouraging many attempts.
  • Efficient and Seamless Integration: While certain security upgrades may seem cumbersome or complex, 2FA manages to find a sweet spot between boosting security and keeping things user-friendly. You’ll likely find the process to be quite natural and intuitive once you get the hang of it.

Now that you know some of the key advantages of using 2FA for your website, let’s walk through how to set this up with WP Ghost.

How to Use Two-Factor with WP Ghost

To use the 2FA feature from WP Ghost, you’ll need the WP Ghost – Advanced Pack plugin. The plugin is installed/activated automatically with a single click, costs nothing extra, and uses the same account.

Activate Two-Factor Authenticator Feature

By default, the 2FA feature is not activated in WP Ghost and is not visible in the menu. To activate the feature and install the advanced pack, follow these steps:

Activate Two-Factor Authenticator feature
  1. Go to WP Ghost > Overview > Features.
  2. From features list, switch on 2FA feature to activate the feature options.
  3. Click on Start Feature Setup to access 2FA Settings page.

If the WP Ghost Advanced Pack is not yet installed, you will see the option to install it with just one click.

WP Ghost Advanced Pack

Simply click on the “Install/Activate WP Ghost – Advanced Pack” button.

The WP Ghost – Advanced Pack plugin is now activated for your website and it is listed among your Plugins.

2FA Code Method

You should start by selecting the Two-Factor Authentication (2FA) method you wish to set up for your website.

Activate 2FA Code

When using this method, you must set up an authenticator app like Google Authenticator or Authy to generate a one-time code.

Once verified, you’ll be asked for the code generated and displayed by your authenticator app whenever you log in. You must enter this code on the login page to confirm your identity and gain access to your WordPress dashboard.

  1. Go to WP Ghost > 2FA Login > Settings.
  2. Click on 2FA Code to activate the Two Factor Authentication by QR Code option.
  3. Click Save to apply the changes.
Activate 2FA Code

Setup 2FA Code

Setup 2FA Code

Let’s take a look at the customization settings that are available for 2FA Code. 

Max fail attempts

This setting determines how many times a user can enter an incorrect 2FA code before their IP is blocked.

Max fail attempts

By default, this is set to 5 attempts, meaning a user will be blocked after five incorrect attempts. Adjust this number if needed.

Ban duration

This setting allows you to customize the duration (in seconds) for which an IP will be banned after exceeding the maximum number of failed attempts.

Ban duration

By default, this is set to 900 seconds, which is 15 minutes. Change this duration if needed.

Failed Attempts Message

Show alert message for a specific user when there were fail attempts on his account.

Failed Attempts Message

This automatic, pre-configured notification alerts users of their login attempts where they fail to provide a valid 2FA code. 

Note! This means the user passed the login credentials but not the 2FA process.

The message will be customized for each user with the following built-in variables: 

  • {count}: Indicates the number of times that particular user didn’t provide a correct code.
  • {time}: Shows the duration since the user’s last failed login attempt.

Lockout Message

Show message instead of the login form for a blocked user.

Lockout Message

This automatic, pre-configured notification will show instead of the WordPress login form when a user experiences a lockout.

The message will be customized for each user with the following built-in variables: 

  • {time}: indicates the number of seconds users must wait before entering a new verification code to attempt logging in again.

Delete 2FA Data on Plugin Uninstall

Delete 2FA Data on Plugin Uninstall

Activate this option if you want all 2FA-related data deleted when the WP Ghost Advanced Pack plugin is uninstalled.

Note! If you activate this option, the users will need to set up 2FA again if you reinstall the plugin and activate the 2FA Authentication feature.

After you configure the 2FA Settings, click on “Save” to apply the changes.

Setup 2FA Code on User Account

After you saved the 2FA Code settings it’s time to setup 2FA authentication for a user.

Click on the Add Two-Factor Authentication button displayed below. If the button is not visible, click the “Save” button first.

Setup 2FA Code on User Account

You will be directed to a section in your User Profile where you can configure 2FA scanning a QR code.

Configure 2FA scanning a QR code

To accomplish this, you will first need to download and open the authenticator app of your preference. You can select from Google Authenticator, Authy, Microsoft Authenticator, or LastPass Authenticator.

For more details:

  • Guide for Google Authenticator
  • Guide for Authy
  • Guide for Microsoft Authenticator
  • Guide for LastPass Authenticator

You will need one of these authenticator apps to scan the QR code provided by WP Ghost and connect your account.

Note! Please be aware that certain authenticator apps may only permit manual entry of the text version. As illustrated in the screenshot below, you can locate the text version in step 2.

2FA Text Key

Once you scan the provided QR code or enter the text version with your chosen authenticator app, the app will generate a series of rotating codes. To complete the setup on your WordPress page, type in the current code displayed in your authenticator app.

Then, click on “Submit” to complete the setup.

2FA Authentication Code

If you have correctly entered the one-time code provided by your chosen authenticator app, you will see the following message:

Authentication Backup Codes

Remember to create and safely store backup codes. They’re your safety net if you can’t access your authenticator app.

Click “Generate Backup Codes” to create your one-time-use recovery codes (each code can be employed only once).

Download 2fa Backup Codes

After you click on the Download Codes button to save them on your computer, click on the Finalize button to complete the process.

Reset Key Option

This option allows you to reset the connection key if you ever encounter issues with your authenticator app or want to start the sync process again.

Reset Users 2FA Keys

Test 2FA Code

Now that 2FA is activated on the user profile, it’s time to test the login page and check the Two-Factor authentication (2FA).

Every time you log in, your authenticator app will ask you for the code currently generated and displayed. You must enter this code on the login page to confirm your identity and gain access to your WordPress dashboard.

Test 2FA Code

2FA Email Code Method

With this method, you will receive a one-time code through email to use during the two-factor verification process.

Note! Before choosing this method, ensure that your WordPress site can reliably send emails. You can improve email delivery using a free email plugin like Easy WP SMTP.

Activate 2FA Email Code

Once you set this up, a unique, one-time code will be sent to the specified email address whenever you try logging in. You’ll have to enter this code on the login page to confirm your identity and gain access to your WordPress dashboard.

  1. Go to WP Ghost > 2FA Login > Settings.
  2. Click on Email Code to activate the Two Factor Authentication by Email option.
  3. Click Save to apply the changes.
Activate 2FA Email Code

Setup 2FA Email Code

Setup 2FA Email Code

Let’s take a look at the customization settings that are available for 2FA Email Code. 

Max fail attempts

This setting determines how many times a user can enter an incorrect 2FA email code before their IP is blocked.

Max fail attempts

By default, this is set to 5 attempts, meaning a user will be blocked after five incorrect attempts. Adjust this number if needed.

Ban duration

This setting allows you to customize the duration (in seconds) for which an IP will be banned after exceeding the maximum number of failed attempts.

Ban duration

By default, this is set to 900 seconds, which is 15 minutes. Change this duration if needed.

Failed Attempts Message

Show alert message for a specific user when there were fail attempts on his account.

Failed Attempts Message

This automatic, pre-configured notification alerts users of their login attempts where they fail to provide a valid 2FA code. 

Note! This means the user passed the login credentials but not the 2FA process.

The message will be customized for each user with the following built-in variables: 

  • {count}: Indicates the number of times that particular user didn’t provide a correct code.
  • {time}: Shows the duration since the user’s last failed login attempt.

Lockout Message

Show message instead of the login form for a blocked user.

Lockout Message

This automatic, pre-configured notification will show instead of the WordPress login form when a user experiences a lockout.

The message will be customized for each user with the following built-in variables: 

  • {time}: indicates the number of seconds users must wait before entering a new verification code to attempt logging in again.

Delete 2FA Data on Plugin Uninstall

Delete 2FA Data on Plugin Uninstall

Activate this option if you want all 2FA-related data deleted when the WP Ghost Advanced Pack plugin is uninstalled.

Note! If you activate this option, the users will need to set up 2FA again if you reinstall the plugin and activate the 2FA Authentication feature.

After you configure the 2FA Settings, click on “Save” to apply the changes.

Setup 2FA Email Code on User Account

After you saved the 2FA Email Code settings it’s time to setup 2FA for a user.

Click on the Add Two-Factor Authentication button displayed below. If the button is not visible, click the Save button first.

Setup 2FA Email Code on User Account

You will be directed to a section in your User Profile where you can specify the email address where you’d like to receive the authentication codes during the login process.

Write down your preferred email address and click on Submit button to complete the setup.

2FA Set Email Address

Once you set this up, a unique, one-time code will be sent to the email address you provided whenever you try to log in. You’ll have to enter this code on the login page to confirm your identity and gain access to your WordPress dashboard.

After you set the email address where you want to receive the unique email code, you will see the following message:

2FA Email Generate Backup Codes

Remember to create and safely store backup codes. They’re your safety net if the SMTP is not working and you don’t receive any 2FA code by email.

Click “Generate Backup Codes” to create your one-time-use recovery codes (each code can be employed only once).

2FA Email Download Codes

After you click the Download Codes button to save them on your computer, click the Finalize button to complete the process.

Reset Email Address Option

If you ever switch email accounts or prefer a different one for receiving codes, you can use this option to update your details.

Reset Email Address Option

Test 2FA Email Code

Now that 2FA is activated on the user profile, it’s time to test the login page and check the Two-Factor authentication (2FA).

Every time you log in, a unique, one-time code will be sent to the email address you provided. You must enter this code on the login page to confirm your identity and gain access to your WordPress dashboard.

Test 2FA Email Code

Consider using a free email plugin, such as Easy WP SMTP, to ensure your emails always get delivered.

Monitor 2FA Logins

To see all recent 2FA authentications, go to WP Ghost > 2FA Login > 2FA Logins

After configuring 2FA for your website, you can monitor your 2FA Logins from a centralized panel.

Monitor 2FA Logins

Here is the information you will be able to view in this section:

  • Email: Shows the email address used for the 2FA login attempt.
  • Last Access: This timestamp indicates the most recent time a user logged in using 2FA. It is helpful in monitoring user activity patterns and identifying unusual access times.
  • Mode: Indicates whether the 2FA login attempt was successful or failed. Monitoring failed login attempts can help identify and prevent unauthorized access attempts.
  • Login: Displays the method of 2FA used for the login – either 2FA Code or Email Code.

Adding 2FA not only amplifies your site’s security but also offers peace of mind by ensuring that only authorized users can gain access. Always ensure that you regularly check the 2FA login monitor for any unusual activity.

Recommendations

  • Don’t overlook the importance of backup codes: Remember to generate and keep backup codes somewhere safe. They will come in handy in case you lose access to your authentication app or registered email address.
  • Test your 2FA: Validate the functionality of your 2FA. You want to be sure it’s working as it should and that you can access your site with these enhanced security measures.
  • Update your plugins regularly: Always keep your plugins, including WP Ghost, up-to-date, as updates often address vulnerabilities and enhance overall performance.

Using WP Ghost, you can easily add two-factor authentication to your WordPress sites. Whether you use a 2FA code or email code verification, it’s a big step up for your site’s security.

Give it a try today to further reduce the risk of unauthorized users gaining access to your site!

Troubleshooting

Authenticator App Not Generating Valid Codes for 2FA

There is a possibility that the application code to offer wrong codes.

Mobile Time and Date

Ensure your device’s date and time settings are set to automatic. An incorrect time can cause codes to mismatch.

Check the code twice

Verify you are entering the correct current code. Codes are time-sensitive and may expire after 30 seconds.

Check the login user

Make sure you are entering the correct code for the right user. If you have multiple accounts on the same website, you need to use the 2FA code for the specific user you want to log in as. Each user has a different 2FA code.

Generate the codes again

You can reset the connection key for a specific user by going to All Users > User Edit and using the Reset Key Option. Then, you can re-scan the QR code with your authenticator app.

Unable to Scan the QR Code

Use the manual entry option in your authenticator app and input the text-based key provided during setup.

2fa code key

Ensure the QR code is displayed clearly on your screen. If necessary, enlarge it to make scanning easier.

Getting Locked Out After Exceeding Max Fail Attempts

By default, if you fail to enter the correct credentials or the 2FA code five times, your IP will be blocked for a period of time.

During the lockout you will get a message like:

Your IP has been flagged for potential security violations. Please try again in a little while.

Solutions:

Solution 1: Wait for the ban duration to expire (default is 15 minutes).

Solution 2: Access the login page using the Safe URL from your WP Ghost Dashboard (Cloud Account). This will deactivate WP Ghost until you log in to the WordPress dashboard with your credentials.

Access login with Safe URL

Solution 3: If you have admin access via File Manager or FTP, disable the WP Ghost plugin by changing the plugin directory hide-my-wp to hide-my-wp1.

rename hide-my-wp directory

After logging in, change the hide-my-wp directory back to re-enable the WP Ghost plugin on your website and clear the blocked IP address from WP Ghost > Brute Force.

Not Receiving the 2FA Email Code

There are a few reasons why the 2FA email code is not received by email.

Check the email address

Verify that the correct email address is configured in the user profile settings. Click Reset Email and add the correct email address for that user profile.

No SMTP Email Solution

Ensure your WordPress site can reliably send emails. Install and configure a plugin like Easy WP SMTP to improve email delivery. Test email functionality after setup.

Junk Email Folder

Check the spam/junk folder in your email inbox. If the email SMTP plugin was not configured correctly, the emails will be sent to spam/junk folder.

Email delay issue

Use a reliable SMTP service to ensure faster email delivery. Avoid using shared hosting email servers, as they may experience delays.

Tagged: two factor autheticatortwo factor2fa securitytwo factor login2fa email code2fa

Related Articles

  • WP Ghost – Advanced Pack

  • Setting up Two-Factor Authentication (2FA) for WordPress Using Mobile Apps

WP Ghost - Best Practice

Learn how to set up WP Ghost in Ghost Mode and activate all the security features you need for a stronger and safer website.

Most Popular

  • Change and Hide wp-admin Path with WP Ghost
  • Setup WP Ghost on Nginx Server
  • WP Ghost Compatibility Plugins List
  • Set AllowOverride all on Apache Servers
  • Theme Not Loading Correctly and Website Loads Slower
  • Lesson 3 – Hide Your Site From Theme Detectors and Hackers Bots
  • Change admin-ajax.php Path with WP Ghost
  • Firewall and Security
  • Lesson 1 – Customize Paths with WP Ghost
  • How To Change File Permissions in WordPress
  • Change plugins Path with WP Ghost
  • Brute Force Attack Protection
  • WP Ghost Settings – Best Practice
  • Change REST API Path with WP Ghost
  • Change and Hide wp-login Path with WP Ghost
  • Change wp-content Path with WP Ghost
  • Two-Factor Authentication
  • Redirects
  • What is WP Ghost?
  • Brute Force Protection in Elementor Login Forms
  • Disable Right-Click and Keys
  • Change wp-register Path with WP Ghost
  • WP Ghost Compatibility Themes List
  • Install WP Ghost Lite Plugin
  • Hide wp-admin And wp-login.php From Source Code
  • Change author Path and Hide ID with WP Ghost
  • Events Log Report
  • Temporary Logins
  • WP Ghost – Advanced Pack
  • Setup WP Ghost on Nginx Web Server With Virtual Private Server

Recommended

  • What is WP Ghost?
  • Changelog
  • Plugin Best Practice
  • Plugin Compatibility
  • Theme Compatibility

Categories

  • Change Paths
  • Firewall
  • Temporary Login
  • Two Factor
  • Brute Force
  • Events Log

Company

  • Affiliate
  • Media Kit
  • Terms Of Use
  • Privacy Policy
  • Contact

Useful

  • Hack Attack Types
  • Key Security Features
  • Security Features
  • Free vs PRO
  • Why WP Ghost
  • Pricing
  • Facebook
  • YouTube
  • X
© WP Ghost 2016-2025