Updated on 22 July, 2026
How to use YubiKey with WP 2FA
WP 2FA supports YubiKey as a secondary WordPress authentication factor. Whether you already use YubiKey, have it implemented in your organization, or would like to switch to using a hardware key, WP 2FA enables you to use YubiKey as your WordPress 2FA authentication method.
In this knowledge base entry, we will be covering how to enable and configure YubiKeys for your WordPress website.
Step 1: Enable YubiKey authentication
For users to be able to select YubiKey as their 2fa method, you must first make it available as a 2FA method from the pluginโs settings.
Note: Enabling YubiKey authentication makes the option available to users setting up 2FA. We cover the configuration process in Step 2, which youโll find below.
After logging in to your WordPress admin dashboard:
- Navigate to WP 2FA > 2FA Policies
- Head to the Select primary 2FA methods section
- Tick the checkbox next to One-time password via YubiKey.

Once ready, scroll down to the bottom of the page and click on Save Changes.
Note: If you want to use YubiKey with an API layer for better credential management, you can generate the required credentials directly through Yubico here. This page walks you through the process of generating the credentials yourself. After that, insert the credentials into integration settings:

Step 2: Configure YubiKey authentication
When YubiKey is enabled as an allowed primary 2FA method, users can choose it when configuring 2FA for their WordPress user account.
It will be one of the available options in the Choose the 2FA method step:

Make sure that the One-time password via YubiKey option is selected, and then click Continue.
Step 2.1: Set up 2FA with YubiKey
Insert your YubiKey and touch (press) the sensor. In most cases, the one-time password will be entered automatically, and you’ll be taken to the next step.
If this doesn’t happen automatically, click I’m ready, then focus the input field and touch your YubiKey again to generate the code.

Step 3.1: Confirm YubiKey configuration
Touch your YubiKey again to generate a new one-time password. In most cases, the code will be entered automatically, and you can continue with the setup.
If the code is not entered automatically, make sure your cursor is in the input field, then touch your YubiKey again to generate and enter the one-time password.

You can then proceed with the rest of your WordPress 2FA configuration process.
More WP 2FA configuration options
Want to learn more about the many features WP 2FA offers? Check out the WP 2FA knowledge base for even more guides and how-toโs.
New to WP 2FA? Get started today and rest easier knowing that your WordPress website is now more secure.