Level 3 · How it works3 min read

Protecting the WordPress login: two-factor sign-in, limits, and XML-RPC

How bots attack the WordPress login, the defenses WordPress itself recommends, two-factor sign-in and passkeys, XML-RPC, and application passwords.

Illustration: a key icon in a rounded tile, with the title Protecting the WordPress login

Key points

  • In a brute-force attack, a bot tries user names and passwords until one works. Its usual targets are the login page and XML-RPC.
  • WordPress core has no two-factor sign-in. A plugin adds it, and passkeys need one more plugin.
  • WordPress advises limiting login attempts at a firewall or on the web server, and turning off XML-RPC if nothing you use needs it.

How attacks on the login work

WordPress describes a brute-force attack as “the simplest way to break in”: an attacker tries user names and passwords until one works. Bots aim at two addresses that every WordPress site has:

  • /wp-login.php, the normal login page.
  • /xmlrpc.php, an older interface for apps. WordPress calls it “a frequent brute-force target,” especially through its method system.multicall.

The defenses WordPress recommends

DefenseWhat it stops
Long, unique passwords from a password managerguessing
Two-factor sign-in for every administratorlogins with a stolen or guessed password
Passkeys (WebAuthn)phishing, because a passkey works only on the real site
Limiting login attempts at a firewall or on the web serverendless guessing
A CAPTCHA or Turnstile on the loginautomated logins
Turning off XML-RPC, or limiting itguessing through XML-RPC
No user named “admin”the easiest guesses

Two things WordPress does not count as real protection: moving the login page to another address “can reduce noise but should not be your only defense.” And it advises against blocking whole countries permanently.

Two-factor sign-in and passkeys

WordPress itself has no two-factor sign-in. The free plugin Two Factor, developed by the WordPress community and used on 100,000+ sites, adds three methods:

  • codes from an authenticator app (TOTP),
  • codes by email,
  • backup codes for when you lose your phone.

For passkeys or security keys, it needs a second plugin, “Two-Factor Provider: WebAuthn.” Many security plugins offer two-factor sign-in as well.

Application passwords

Since WordPress 5.6 of December 2020, apps can connect to your site with application passwords instead of your real password. In your user profile, you see which apps are connected and can revoke them. Revoke every one you no longer use.

What you can do

  1. Turn on two-factor sign-in for every account with the role Administrator or Editor.
  2. Limit login attempts at your firewall, on the web server, or with a security plugin.
  3. Open example.com/xmlrpc.php on your site. If it says “XML-RPC server accepts POST requests only.”, the interface is on. Turn it off if no app or service of yours needs it.
  4. Check your users under Users. Delete accounts nobody uses, and make sure none is called “admin.”
  5. Review the application passwords in each administrator’s profile and revoke the unused ones.

Next step

The guide How do bots find WordPress sites? shows how bots learn your user names in the first place.

The figures in this guide come from the archive and change with every data update. As of November 13, 2026.

Check it with the archive's data