Every WordPress site has the same login address, and automated tools know it. They try common usernames and leaked passwords around the clock, on large and small sites alike. Nobody is singling you out; your site is simply on a list.
The good news is that a secure WordPress login does not need exotic tools. A few settings, applied consistently, remove most of the easy wins an attacker is hoping for. This guide goes through them in order of impact.
Why the login page attracts so much traffic
WordPress serves its login form at /wp-login.php and redirects /wp-admin/ there when you are not signed in. Anyone can find it, so the question is not whether bots will knock but what they find when they do.
Attackers mainly rely on two techniques. The first is guessing: trying usernames such as admin or the site's name with lists of common passwords. The second is credential stuffing: reusing email and password pairs that leaked from another service. If an administrator uses the same password elsewhere, the second technique can succeed on the first attempt.
A third entry point is less visible: the XML-RPC interface at xmlrpc.php, which also accepts a username and password. We will come back to it below.
Use passwords that cannot be guessed
Start with the basics, because everything else builds on them.
- Long and unique. Every account with access to the dashboard needs its own password, used nowhere else. Length matters more than clever symbols; a random passphrase of several words works well.
- Use a password manager. It is the only realistic way to keep unique passwords for every site and service. Share access through the manager's sharing feature, not by email or chat.
- Avoid predictable usernames.
adminis the first name any bot tries. If you still have an account with that name, create a new administrator, log in with it, and delete the old one, assigning its content to the new account. - One account per person. Shared logins make it impossible to know who did what, and impossible to remove one person's access cleanly.
If you suspect a password has leaked, change it, then also change the security keys (salts) in wp-config.php. This signs out every active session, including any an attacker may hold. WordPress.org provides a generator at api.wordpress.org/secret-key/1.1/salt/; paste the new lines over the existing AUTH_KEY, SECURE_AUTH_KEY and related definitions.
Turn on two-step login for every administrator
Two-step login (also called two-factor authentication, or 2FA) asks for a second proof after the password, usually a six-digit code from an authenticator app or a physical security key. A stolen or guessed password is then no longer enough on its own.
WordPress does not include two-step login out of the box, so you add it with a plugin. When choosing one, look for:
- support for authenticator apps (TOTP) and, ideally, security keys;
- backup codes, so a lost phone does not lock you out;
- the option to require two-step login for specific roles.
Make it mandatory for administrators and editors at minimum. These roles can install code or publish content, which is exactly what an attacker wants. Store the backup codes in your password manager.
Limit login attempts
Out of the box, WordPress lets anyone submit the login form as often as they like. Limiting attempts slows guessing down to the point where it stops being worthwhile.
You can do this at different levels:
- A security plugin that locks out an IP address after a number of failed attempts for a period of time.
- A web application firewall (WAF) at your host or in front of your site, which can filter requests before they reach WordPress.
- Your host's own protection, which some providers apply to
wp-login.phpby default. Ask them.
Keep the lockout reasonable. Locking out real users after two typos creates support work without adding much protection. Some people also move the login page to a custom address. It reduces noise in your logs, but it is not a replacement for strong passwords and two-step login.
Decide what to do with XML-RPC
XML-RPC is an older interface that lets external applications talk to WordPress. It accepts credentials, and some of its methods allow many login attempts in a single request, which makes it attractive for password guessing.
Before switching it off, check whether anything relies on it. The WordPress mobile app and Jetpack can depend on XML-RPC, as can some older publishing tools. Most modern integrations use the REST API instead.
If nothing needs it, you can block the file at server level. On Apache 2.4:
<Files xmlrpc.php>
Require all denied
</Files>
On Nginx:
location = /xmlrpc.php {
deny all;
}
There is also a WordPress filter, add_filter( 'xmlrpc_enabled', '__return_false' );, but it only disables the methods that require authentication. Blocking the file at server level is more thorough. Test your integrations afterwards.
Tidy up accounts and the admin area
A secure login also means fewer doors to guard.
- Review your users every few months. Delete accounts of former staff, agencies and freelancers who no longer work on the site.
- Give the lowest role that does the job. Someone who writes articles needs Author or Editor, not Administrator.
- Disable the built-in file editor. If an administrator account is ever taken over, the editor under Appearance and Plugins lets the attacker change PHP code directly from the browser. Add this line to
wp-config.php:
define( 'DISALLOW_FILE_EDIT', true );
- Keep everything up to date. An outdated plugin can offer a way in that bypasses the login entirely. Our guide on updating plugins and themes safely explains how to do it without breaking things.
Watch who logs in
Prevention is only half the job. You also want to know when something unusual happens: a login at an odd hour, a new administrator you did not create, a burst of failed attempts. Many site owners only find out weeks later, when the damage is visible. If that has already happened, our checklist for a hacked WordPress site walks you through the first steps.