
A password on its own is no longer enough to protect your WordPress site. Passwords get guessed, reused, phished and leaked in data breaches, and WordPress sites are targeted constantly by automated login attacks.
Two-factor authentication (2FA) is one of the most effective ways to stop someone logging in with a stolen password. This article explains why it matters and shows you how to set it up with the free Wordfence plugin and an authenticator app such as Google Authenticator.
What is two-factor authentication?
Two-factor authentication adds a second check when you log in. After entering your username and password, you also enter a short code from an app on your phone. The code changes every 30 seconds, so even if someone has your password, they can’t log in without your phone.
Why does your WordPress site need 2FA?
Passwords can be compromised in several ways:
- Brute-force attacks, where automated tools try thousands of password combinations
- Phishing, where fake emails or login pages trick people into handing over their details
- Data breaches, where passwords leaked from another service are tried on your site
- Reused or weak passwords that are easy to guess
Once someone logs in with administrator access, they can change content, add malicious code, create new admin accounts or lock you out of your own site. Cleaning up a hacked site takes time and money, and it can damage your reputation and search rankings.
With 2FA turned on, a stolen password on its own isn’t enough. The attacker would also need physical access to your phone.
How do you set up 2FA with Wordfence?
Wordfence’s free version includes two-factor authentication. You’ll need about 10 minutes and your phone.
Step 1: install and activate Wordfence
In your WordPress dashboard, go to Plugins > Add New Plugin, search for “Wordfence” and click Install Now.


Once it’s installed, click Activate.

Wordfence will ask you to register for a free licence. Follow the prompts to complete this.
Step 2: open the 2FA settings
In your WordPress dashboard, go to Wordfence > Login Security.

On the Two-Factor Authentication tab, you’ll see a QR code and a set of recovery codes.

Step 3: connect your authenticator app
- Install an authenticator app on your phone if you don’t already have one. Google Authenticator and Microsoft Authenticator are both free on the App Store and Google Play.
- Download your recovery codes and store them somewhere safe, such as your password manager. Each code lets you log in once if you lose your phone. This step is optional, but we strongly recommend it.
- Scan the QR code. In the app, tap the + button, choose to scan a QR code and point your camera at the code on screen.
- Enter the code. The app will show a six-digit code. Enter it in Wordfence and click Activate.

Step 4: decide who must use 2FA
On the Settings tab under Login Security, choose which user roles must use 2FA. At a minimum, require it for administrators. It’s also worth requiring it for editors and shop managers, or anyone else who can change content, settings or orders.
Let your other users know it’s coming and how to set it up, so nobody is locked out unexpectedly.
Step 5: test it
Log out and log back in. After entering your username and password, you should be asked for a code from your authenticator app. Once that works, 2FA is active on your account.
What else should you do to secure WordPress?
2FA is an important layer, but it works best alongside other basics:
- Keep WordPress, themes and plugins updated. Most successful attacks use known security flaws in outdated software. Our guide on how to update WordPress safely explains how to do it without breaking your site.
- Use strong, unique passwords for every account, ideally stored in a password manager.
- Remove old user accounts and give each person only the access they need.
- Keep regular backups stored away from your server.
- Use Wordfence’s other features, including its firewall, malware scanning and brute-force protection.
- Choose good hosting that keeps server software up to date and isolates sites from each other.
Our article on whether WordPress is secure covers the real risks and how to manage them.
Frequently asked questions
Want help securing your WordPress site?
We set up and manage WordPress security for our clients, including 2FA, firewalls, updates, backups and monitoring. Take a look at our WordPress security services or get in touch to have your site checked.

