Security

How to Secure Your WordPress Login: 2FA, Passkeys, Login Limits and Bot Protection

Secure your WordPress login with strong passwords, 2FA, passkeys, login limits and bot checks, plus safe access for staff, agencies and freelancers.

How to Secure Your WordPress Login: 2FA, Passkeys, Login Limits and Bot Protection
On this page
  1. Login protections, by how much they help
  2. Strong, unique passwords, and application passwords
  3. Two-factor authentication
  4. Passkeys
  5. Limit login attempts
  6. Cloudflare Turnstile and other bot checks
  7. Should you change the login URL?
  8. The other doors into your site
  9. Login alerts, sessions and roles
  10. Signs someone has already logged in
  11. Giving access to staff, agencies and developers safely
  12. Quick check
  13. When to get help
  14. FAQs
Key takeaways
  • Unique passwords and two-factor authentication stop most login attacks; passkeys go further where supported.
  • Limit login attempts, add a bot check and protect XML-RPC and application passwords, the other doors into a site.
  • Give every person their own account with the lowest role they need, and remove access when the work ends.

To secure your WordPress login, give every administrator, editor and shop manager their own account with a long, unique password from a password manager, turn on two-factor authentication (2FA) for anyone who can change the site, limit failed login attempts, and add a bot check such as Cloudflare Turnstile to the login form. Passkeys are the strongest option where your plugins support them. Changing the login URL cuts bot noise, but it isn't real protection on its own.

If unknown admin accounts have already appeared, someone may already have got in, and this becomes a cleanup first. Resetting passwords and users is part of my WordPress malware removal service, along with removing whatever the attacker left behind.

Login security is one part of the wider WordPress security checklist. This guide goes into the login itself in more depth.

Login protections, by how much they help

ProtectionWhat it stopsEffort
Two-factor authenticationLogins with a stolen, guessed or reused passwordLow: a plugin and an app on each phone
Unique passwords from a password managerCredential stuffing with passwords leaked elsewhereLow
PasskeysPassword theft and phishingLow to medium; plugin support varies
Login attempt limitsEndless password guessing from one addressLow
Cloudflare Turnstile or another bot checkAutomated login attemptsLow
Restricting XML-RPCPassword guessing through xmlrpc.phpLow, after checking nothing needs it
Firewall rate limitingLarge distributed attacksMedium
Changing the login URLBot noise in your logsLow, with some side effects

Strong, unique passwords, and application passwords

  • Use a password manager to generate and store long, random passwords, and never reuse one from another service. Passwords leaked in someone else's breach are what credential-stuffing bots try first.
  • One account per person. A shared login can't be taken away from one person and leaves no record of who did what.
  • Don't use "admin" as a username, and make sure your public display name isn't your login name. Usernames aren't secret, but there's no reason to hand them out.
  • Check application passwords. Since WordPress 5.6, each profile has an Application Passwords section, used by apps and integrations to connect without your main password. Revoke any you don't recognise; an attacker with admin access can add one to keep a way back in. If nothing uses them, a security plugin setting or a small code snippet can turn the feature off.

Two-factor authentication

2FA asks for a second proof, usually a six-digit code from an app on your phone, after the password, so a stolen password alone is no longer enough. Free options at the time of writing include Wordfence Login Security, Solid Security's free version and the Two Factor plugin maintained by WordPress.org contributors.

MethodHow strongNotes
Authenticator app (Google Authenticator, Microsoft Authenticator and similar)StrongThe sensible default for most sites
Code by emailModerateOnly as safe as the inbox; better than nothing for less technical editors
Code by SMSModerateCan be lost to a SIM swap; needs an SMS service
Security key or passkeyStrongestResistant to phishing; needs plugin support

Make it mandatory for administrators, editors and shop managers, not just available. Save the backup codes in your password manager, so a lost or reset phone doesn't lock you out.

Passkeys

A passkey replaces the password with a cryptographic key stored on your phone, computer or password manager, unlocked with your fingerprint, face or device PIN. There is nothing to guess or reuse, and a fake login page can't capture it, because the passkey only works on the real domain. WordPress core doesn't include passkeys at the time of writing, but some security plugins, including Solid Security's paid version, and dedicated passkey plugins add them. If yours supports passkeys, they are a good choice for administrators; keep 2FA as a fallback.

Limit login attempts

Login limits lock out an IP address after a set number of failed attempts. Most security plugins include this, as do some hosts. Keep the lockout short at first, and make sure you have another way back in, such as your hosting account or a second admin.

One common problem: if your site sits behind Cloudflare or another proxy, the plugin may see the proxy's IP address instead of the visitor's. It then either locks out many real people at once or never locks anyone out. Check the plugin's setting for how it detects IP addresses and point it at the header your proxy uses. Large attacks also come from thousands of addresses at once, which is why 2FA matters more than limits.

Cloudflare Turnstile and other bot checks

Turnstile is Cloudflare's free alternative to a CAPTCHA. Most visitors never see a puzzle: it runs a quick background check and lets real people through. You don't need to use Cloudflare's CDN to use it. Add it, with a dedicated plugin or your security plugin, to every form that logs people in or creates accounts:

  • wp-login.php, including the lost password and registration forms
  • WooCommerce's My Account login and registration, and the checkout if bots hit it
  • Any custom login page your theme or membership plugin adds

Test logging in afterwards in a private window, because caching and script-delay settings can stop the check from loading.

Should you change the login URL?

Moving wp-login.php to a custom address, an option in Solid Security and several small plugins, is popular advice. It has real benefits and real limits.

  • For: far fewer automated attempts reach the login page, so logs are quieter and the server does less work during bot floods.
  • Against: it is obscurity, not protection, and the address can leak through links, emails or plugins. Some plugins, themes and integrations assume the default address, and staff forget the new one. WooCommerce's My Account login and XML-RPC are separate ways in that stay open.

It is fine as an extra on top of 2FA and login limits, not instead of them.

The other doors into your site

  • XML-RPC: lets bots try many passwords in one request. Block or restrict it if nothing uses it; see WordPress XML-RPC explained.
  • WooCommerce account login: needs the same 2FA, limits and bot check as wp-login.php.
  • Hosting, domain and email accounts: a stolen hosting password bypasses every WordPress protection, and whoever controls your email can reset your WordPress password. Turn on 2FA for all three.
  • A firewall: can rate-limit login pages before requests reach WordPress; see WordPress firewalls explained.

Login alerts, sessions and roles

  • Get alerts for admin logins. Most security plugins can email you when an administrator logs in, or when a new admin account is created. An activity log records the rest.
  • Mind session length. By default WordPress keeps you logged in for two days, or two weeks if you tick Remember Me. On shared or office computers, don't tick it, and log out when you finish.
  • Give fewer people admin rights. Writers need Author or Editor access, and staff who process orders need Shop Manager, not Administrator. Every account that can't install plugins is one less way to plant a backdoor.
  • Remove accounts when people leave, including agencies and freelancers once a project ends.

Login hardening works best alongside regular updates and backups. If you need two-factor login, roles and access logs set up properly, you can hire a WordPress developer to secure the admin area.

Signs someone has already logged in

  • Administrator accounts nobody recognises, or a count in the Users screen that doesn't match the accounts you can see
  • Application passwords you didn't create
  • The admin email address changed under Settings > General
  • Login alerts from places you've never been

If you see any of these, use Log Out Everywhere Else in your profile, change your password from a clean device, remove the unknown accounts and treat the site as possibly compromised. The user account audit explains how to review every account properly. If you've simply locked yourself out, fixing WordPress login problems covers safe ways back in.

Giving access to staff, agencies and developers safely

Many WordPress logins get compromised not through attacks on wp-admin, but through shared or forgotten accounts. If several people work on your site, these habits matter as much as any plugin.

One person, one account

Never share the main admin login, even with a trusted developer. Create a separate account for each person so you can see who did what and remove one person without changing everyone's password. The activity log, if you use one, only makes sense when each account belongs to one human.

The lowest role that does the job

  • Content writers: Author or Contributor, so they can't publish or edit other people's work without review.
  • Marketing staff updating pages: Editor.
  • Shop staff processing orders: WooCommerce's Shop Manager role, not Administrator.
  • Developers and agencies: Administrator only while they need it, ideally on a staging copy first.

Temporary access with an end date

For one-off jobs, create the account when the work starts and delete it, or downgrade it, when it ends. Some security and user plugins can create temporary logins that expire automatically. Ask any freelancer or agency to use their own email address on the account, with 2FA switched on, so a reset never goes to a shared inbox.

Hosting, DNS and email logins too

Your WordPress login is only one key. Hosting control panels, the domain registrar, Cloudflare and the email admin console can all be used to take over a site. Keep these in the business's name, turn on 2FA on each, and store the recovery codes somewhere safe that isn't the same phone.

If you're an agency handing client sites to a developer, the same rules apply in both directions; I work this way with agencies that outsource WordPress development, using named accounts and removing access once a project is handed over.

Quick check

List every user who can change the site and check each has 2FA turned on:

wp user list --role=administrator --fields=user_login,user_email,user_registered
wp user list --role=shop_manager --fields=user_login,user_email

Without WP-CLI, use Users > All Users and filter by role. Then log in from a private window to confirm the 2FA prompt actually appears.

When to get help

If unknown admin accounts have appeared, you're locked out, or you think someone has logged in without permission, treat it as a possible hack, not a login settings problem. Cleanup and access review are part of WordPress malware removal. Send the details through the contact form for a fixed quote.

Locked out after tightening security? See how to reset a WordPress password in phpMyAdmin, then come back and set a strong one.

FAQs

What is the best way to secure a WordPress login?

Two-factor authentication for everyone who can change the site, unique passwords from a password manager, login limits and a bot check. Together those stop most login attacks.

Is 2FA really necessary on a small business site?

Yes. Login attacks are automated and don't care how big your site is, and 2FA is free and takes a few minutes per user to set up.

Does changing the wp-admin login URL make WordPress more secure?

Only slightly. It reduces bot traffic and log noise, but a determined attacker can still find a way to log in. Treat it as an extra, not a substitute for 2FA.

Can I use passkeys with WordPress?

Yes, through a plugin, since WordPress core doesn't include them at the time of writing. Check your security plugin first, and keep 2FA as a fallback.

What if I lose the phone with my 2FA app?

Use a backup code, or ask another administrator to reset your 2FA. If neither is possible, temporarily disabling the 2FA plugin by renaming its folder over SFTP gets you back in; set 2FA up again straight away.

Is Cloudflare Turnstile better than reCAPTCHA?

For most sites it is easier on visitors, rarely showing a puzzle, and it doesn't require the Cloudflare CDN. Both work; what matters is that the check is on every login form.

Need help with your website?

I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.

Found this useful? Share it:
Contact

Let's build your next website

Available for freelance projects, agency white-label work and long-term maintenance. Feel free to pass this along to your team or company.

I reply within 24 hours, usually the same day. Your details are emailed to me, then WhatsApp opens so we can chat right away.

Chat now