Security 5 min read

Securing WordPress logins: strong passwords, 2FA and limits

How to secure WordPress logins: strong unique passwords, two-factor authentication, passkeys, login limits, CAPTCHA, session control and protecting wp-admin.

Usman Muhammad UsmanUpdated October 13, 2026
Securing WordPress logins: strong passwords, 2FA and limits

The WordPress login page is the front door to your website, and bots knock on it constantly. A stolen or guessed administrator password gives an attacker full control. Securing logins is one of the quickest, most effective security improvements you can make. Here is how I lock down logins on client sites without making life difficult for the people who use them.

Why logins are targeted

Automated bots try common usernames and passwords on wp-login.php and XML-RPC around the clock. Others use passwords leaked from breaches of other websites, hoping people have reused them. Phishing emails try to trick editors into entering their details on fake login pages.

Each method relies on weak, reused or stolen passwords. Strong passwords and a second factor defeat almost all of them.

Strong, unique passwords

Use long passwords, ideally generated by a password manager, and a different one for every site and service. Length matters more than complexity; a long random password or passphrase is far harder to crack than a short one with symbols.

WordPress shows a strength meter when creating passwords. Require strong passwords for all users with a security plugin if your team tends to choose weak ones. See password managers for teams.

Login security layers
  • Unique passwordsFrom a password manager
  • No admin usernameDifferent display name
  • 2FA or passkeysEvery privileged user
  • Login limitsLock out repeat failures
  • XML-RPCDisable if unused
  • Activity logAlerts for new logins

Avoid predictable usernames

Do not use admin, administrator or your business name as a username. Bots try these first. Make sure your public display name is different from your login username, so it does not appear on posts and author archives.

If an old account uses admin, create a new administrator with a different username, log in with it, then delete the old account and assign its content to the new one.

Two-factor authentication

Two-factor authentication adds a second step after the password: a code from an authenticator app such as Google Authenticator, Microsoft Authenticator or Authy, a security key or an email code. Even if the password is stolen, the attacker cannot log in without the second factor.

Enable 2FA for every administrator, editor and shop manager. Authenticator apps and security keys are more secure than SMS or email codes. Save backup codes in a secure place.

Passkeys

Passkeys let users sign in with a fingerprint, face recognition or device PIN instead of a password. They are resistant to phishing because they only work on the genuine website. Several WordPress plugins now support passkeys, and adoption is growing.

For teams comfortable with modern devices, passkeys combine convenience with strong security. Keep 2FA as a fallback option.

Limit login attempts

Limit how many failed login attempts are allowed before an IP address is temporarily blocked. This stops brute force attacks and reduces server load. Most security plugins include this feature, and some hosts block repeated failed logins at the server level.

Set sensible limits, such as five attempts before a short lockout, increasing for repeat offenders. See brute force attack protection.

CAPTCHA on login

Adding Cloudflare Turnstile or reCAPTCHA to the login page blocks many automated attempts. Turnstile works mostly invisibly and respects privacy. Use it as an extra layer alongside login limits and 2FA, not instead of them.

Test that CAPTCHA does not block legitimate logins, password resets or WooCommerce account pages.

Protect XML-RPC

XML-RPC is an older interface that allows remote publishing and is often abused for brute force attacks, because it can test many passwords in one request. If you do not use the WordPress mobile app, Jetpack or remote publishing, disable it or block it at the firewall.

See XML-RPC and WordPress security for when it is safe to disable.

Changing the login URL

Moving the login page from wp-login.php to a custom address reduces bot traffic and log noise. It is not real security on its own, because determined attackers can find it, but it reduces automated attempts significantly.

See should you change the WordPress login URL for the pros and cons.

Session control

Log out users after periods of inactivity on shared computers, and limit how long login cookies last for administrators. When someone leaves your organisation, remove their account immediately and change any shared passwords they knew.

Updating the security keys in wp-config.php logs out all users, which is useful after a suspected compromise.

Protect against phishing

Train your team to check the address bar before entering login details and to be suspicious of emails asking them to log in urgently. Phishing is often the easiest way to steal credentials, and 2FA or passkeys provide the best protection.

See protecting your business from phishing.

Login security for customers and members

On stores and membership sites, customers also log in. Their accounts hold addresses, order history and sometimes saved payment tokens. Rate limit the My Account login, block known bad IPs at the firewall and alert on unusual spikes in failed logins, which often signal credential stuffing.

Offer passkeys or one-time email codes as options where your plugins support them, and keep password reset emails reliable with SMTP. Avoid forcing 2FA on every customer, which can hurt conversions; focus strict requirements on staff.

Monitor logins

An activity log records successful and failed logins, new users and role changes. Alerts for administrator logins from new locations help you spot compromised accounts quickly. Review the log periodically.

Login security is part of my security hardening checklist and my website protection service. See also WordPress activity logs.

Key takeaways

  • Strong, unique passwords and 2FA stop almost all login attacks.
  • Avoid predictable usernames and separate display names from logins.
  • Limit login attempts and disable XML-RPC if you do not use it.
  • Monitor logins and remove accounts as soon as people leave.

Frequently asked questions

Which 2FA method is best?

Authenticator apps or hardware security keys. SMS and email codes are better than nothing but weaker.

Does 2FA work with WooCommerce customer accounts?

Yes, though many stores only require it for staff accounts to keep checkout simple.

Can I force strong passwords?

Yes. Security plugins can enforce password strength for selected roles.

What happens if I lose my 2FA phone?

Use your backup codes, or ask another administrator or your host to disable 2FA temporarily.

Is changing the login URL enough?

No. It reduces bot noise but should be combined with strong passwords and 2FA.

How do I know if someone tried to log in?

An activity log or security plugin records failed and successful login attempts.

Free website audit

Get a free audit of your website

Tell me your URL and I'll send a short, prioritized list of the speed, SEO and security fixes that will make the biggest difference.

  • No obligation, no sales call
  • 5.0 rating on Google and Upwork
  • Reply within one business day
Written by Muhammad UsmanWeb Development Team Lead with 5+ years building WordPress, WooCommerce, Shopify and Wix websites. Experience · Certificates About me

More on Security

All Security articles

Have a project in mind?

Tell me what you're building and I'll reply with next steps and an estimate.