A strong password isn’t enough anymore: passwords leak, get reused and get guessed by bots. Two-factor authentication (2FA) adds a second step to logging in, a six-digit code from your phone, so a stolen password alone can’t open the account. This guide explains how 2FA works in WordPress and how to turn it on for your admin login, your members and your WooCommerce customers with WP ULike Pro.
Short answer: go to WP ULike → Settings → Login & Signup, turn on Enable 2-factor Authentication, and add the [wp_ulike_pro_two_factor_setup] shortcode to a profile tab or account page. Users scan a QR code with an authenticator app, and from then on they enter a code after their password.
What is two-factor authentication?
Two-factor authentication asks for two different things when you sign in: something you know (your password) and something you have (your phone). WP ULike Pro uses TOTP, the time-based one-time passwords behind apps like Google Authenticator: your phone shows a new six-digit code every 30 seconds, and the site only accepts the current one.
Authenticator apps are safer than codes sent by text message, work without a phone signal, and are free: Google Authenticator, Microsoft Authenticator, Authy, 1Password and any other TOTP app all work.
Which logins are protected
Once a user turns on 2FA, WP ULike Pro asks for their code wherever they sign in with a password, not only on its own forms:
| Where the user signs in | What happens |
|---|---|
| WP ULike Pro login form | Asks for the code after the password |
The standard WordPress login (wp-login.php), including admins | Asks for the code after the password |
| WooCommerce My Account login | Asks for the code on the same page |
| Other plugins’ login forms (for example Ultimate Member or MemberPress) | Refuses the login and points to your login page, so 2FA can’t be bypassed |
| XML-RPC | Refuses the account password |
| Application passwords (REST API, mobile apps) | Keep working |
Social logins skip the code, since the user already verified with Google, GitHub or another provider. Accounts without 2FA sign in exactly as before.
How to set up 2FA in WordPress
Step 1: Turn it on
Go to WP ULike → Settings → Configuration → Login & Signup, turn on Enable 2-factor Authentication and save.

Step 2: Add the setup page
Users need a place to connect their phone. Add [wp_ulike_pro_two_factor_setup] to a tab on their user profile or to the edit-account page.
Step 3: Users connect their authenticator app
- Open the setup page while logged in.
- Scan the QR code with an authenticator app.
- Type the six-digit code from the app and submit.
The phone now appears in their list of devices. Users can add several devices (up to 5 by default) and remove old ones from the same page.

Step 4: Sign in with a code
From now on, users enter their username and password as usual, then the current code from their app. A wrong or expired code shows a clear message, and they can simply try the next one.
Two-factor authentication for WooCommerce
Customer accounts hold addresses and order history, so they deserve protection too. With WP ULike Pro active, customers who turn on 2FA are asked for their code right on the WooCommerce My Account login, without being sent to wp-login.php. Put the setup shortcode on a My Account tab or a page you link from it.
Tips for a smooth rollout
- Start with admins and editors, the accounts that can do the most damage, then encourage members.
- Exclude the login and 2FA setup pages from page caching (LiteSpeed, WP Rocket and others).
- Test in a private window before telling users about it.
- If someone loses their phone, an administrator can turn off 2FA for that account in the WordPress user settings.
- Combine it with Google reCAPTCHA, email verification and social login, all under the same Login & Signup settings.
2FA is part of WP ULike Pro’s login, signup and profile tools. See everything that’s included in WP ULike Free vs Pro.
Frequently asked questions
With WP ULike Pro, turn on Enable 2-factor Authentication under WP ULike → Settings → Login & Signup, then add the two-factor setup shortcode to a profile or account page. Users scan a QR code with an authenticator app to finish.
Yes. Users with 2FA turned on are asked for their code on the standard wp-login.php page too, including administrators.
Yes. Customers with 2FA are asked for their code on the WooCommerce My Account login form.
Any app that supports TOTP codes, such as Google Authenticator, Microsoft Authenticator, Authy or 1Password.
An administrator can turn off two-factor authentication for that account in the WordPress user settings, and the user can set it up again on a new device.
Social logins don’t ask for a code, because the user already signs in through Google, GitHub or another provider.
No. Two-factor authentication is part of WP ULike Pro, along with login and signup forms, profiles and social login.



Leave a Reply