> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to add Two-Factor Authentication (2FA) to MainWP

> Add two-factor authentication to your MainWP Dashboard using a WordPress 2FA plugin for an additional layer of login security.

[How to add Two-Factor Authentication (2FA) to MainWP - Video Tutorial](https://www.youtube.com/embed/R8barom9fyc)

Two-factor authentication adds a second verification step when logging into your WordPress Dashboard. Enabling 2FA on your MainWP Dashboard does not affect MainWP functionality—it only secures the WordPress login process.

## What You'll Learn

* How to install and configure a 2FA plugin on your Dashboard
* How to set up your authenticator app
* How to enforce 2FA for Dashboard users

## Prerequisites

* Admin access to your MainWP Dashboard WordPress site
* An authenticator app (Google Authenticator, Authy, 1Password, etc.)

***

## Install the 2FA Plugin

This example uses WP 2FA, but you can use any WordPress 2FA plugin.

**1. Go to Add Plugins**

From your MainWP Dashboard, navigate to **WP Admin > Plugins > Add New**.

**2. Search and install**

Search for **WP 2FA** and install it.

**3. Activate the plugin**

Activate the plugin. The setup wizard starts automatically.

***

## Configure 2FA Settings

**1. Choose authentication method**

Select your preferred 2FA method:

* **One-time code via 2FA app** (TOTP)
* **One-time code via email**

  ![2FA Settings - method selection](https://mintcdn.com/mainwp/BNdtsT0iNiekSNfE/images/miscellaneous/f9a6fdb0cc68.png?fit=max\&auto=format\&n=BNdtsT0iNiekSNfE\&q=85\&s=34625bef15897df43daa8315f4b883f7)

**2. Select users to enforce 2FA**

Choose which users must use 2FA.

![2FA Settings - user selection](https://mintcdn.com/mainwp/IR8CPI-HSZJmZwTU/images/miscellaneous/7122620c4316.png?fit=max\&auto=format\&n=IR8CPI-HSZJmZwTU\&q=85\&s=dc9a0caa89cd03fa61b1f54792865788)

**3. Exclude users (optional)**

Optionally exclude specific users or roles from the 2FA requirement.

![2FA Settings - role selection](https://mintcdn.com/mainwp/IR8CPI-HSZJmZwTU/images/miscellaneous/6b7b13138b60.png?fit=max\&auto=format\&n=IR8CPI-HSZJmZwTU\&q=85\&s=4205564982136c3efc29e35dfef28f87)

**4. Set grace period**

Give users time to set up 2FA before it becomes mandatory.

![2FA Settings - grace period selection](https://mintcdn.com/mainwp/BNdtsT0iNiekSNfE/images/miscellaneous/cc8f42556733.png?fit=max\&auto=format\&n=BNdtsT0iNiekSNfE\&q=85\&s=6854e31e6be8df0a1970e027a097b90c)

***

## Set Up Your Authenticator App

**1. Scan the QR code**

Scan the QR code or enter the code manually in your authenticator app.

![Authy plugin installation](https://mintcdn.com/mainwp/OKpZbeo5_cAajLyl/images/miscellaneous/advanced-miscellaneous-428b02.png?fit=max\&auto=format\&n=OKpZbeo5_cAajLyl\&q=85\&s=63a8a060b8e4832afab8a5dec4222677)

**2. Save the entry**

Give the account a name and save. The app now generates 6-digit codes.

![Authy plugin code scan](https://mintcdn.com/mainwp/IR8CPI-HSZJmZwTU/images/miscellaneous/67e918c8924b.png?fit=max\&auto=format\&n=IR8CPI-HSZJmZwTU\&q=85\&s=edd4618adb78f46fc671844eae973f63)

**3. Verify the code**

Click **I'M READY**, enter the current code from your app, and click **Validate and Save**.

![Authy plugin settings confirmation](https://mintcdn.com/mainwp/p-OFo6sXMnWfaTaL/images/miscellaneous/0e148d22c4c3.png?fit=max\&auto=format\&n=p-OFo6sXMnWfaTaL\&q=85\&s=f797fb9b733f3dca64981eab32d3dd0c)

**4. Generate backup codes**

Optionally generate backup codes in case you lose access to your authenticator app.

![Authy plugin backup codes](https://mintcdn.com/mainwp/IR8CPI-HSZJmZwTU/images/miscellaneous/7f1247cfbd94.png?fit=max\&auto=format\&n=IR8CPI-HSZJmZwTU\&q=85\&s=df3f8851029f498e83296e9ac2d388db)

***

## Logging In with 2FA

After setup, the login process requires two steps:

1. Enter your username and password as usual
2. Enter the current 6-digit code from your authenticator app

![2FA login code](https://mintcdn.com/mainwp/p-OFo6sXMnWfaTaL/images/miscellaneous/31d5e1619b74.png?fit=max\&auto=format\&n=p-OFo6sXMnWfaTaL\&q=85\&s=960748da8a6c4ace22eab6dfa79999f5)

***

## Self-Check Checklist

* [ ] 2FA plugin installed and activated on Dashboard
* [ ] Authentication method configured
* [ ] Authenticator app scanning completed
* [ ] Verification code validated
* [ ] Backup codes generated and stored securely
* [ ] Login tested with 2FA verification

***

## Related Resources

* [MainWP.com Account Security](https://docs.mainwp.com/advanced/miscellaneous/mainwp-com-login-security.md) - 2FA for your MainWP.com account
* [MainWP Security](https://docs.mainwp.com/getting-started/how-secure-is-the-mainwp-plugin.md) - Overall security architecture
* [Connection Security](https://docs.mainwp.com/advanced/miscellaneous/mainwp-connection-security.md) - Dashboard-to-Child communication


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.