How to Secure the WordPress Login Page: A Layered Guide for 2026

Picture of Ivan Predojev
Ivan Predojev

Writer

Table of Contents

Every WordPress site has the same front door, and attackers know exactly where it is. Type any WordPress domain followed by /wp-login.php and you will almost always reach a login form. Bots do this thousands of times a day across the web, trying usernames and passwords until something works. That is why wordpress login security is not an advanced topic for large sites only. A small brochure site with one admin account is as likely to be hit as a busy store, simply because the scanning is automated and indiscriminate.

The good news is that the login page is also one of the easiest parts of WordPress to protect well, as long as you think in layers rather than single tricks. This guide explains how login attacks actually work, which defenses stop them and which only look like they do, how application passwords and XML-RPC quietly sit outside your login form, why server-level protection beats plugin-only protection, and what to do if you think someone already got in.

Why Attackers Target wp-login.php and XML-RPC

Before choosing defenses, it helps to understand what you are defending against. The login page is attractive because a successful attack gives full control of the site. With one administrator account an attacker can install a plugin, upload code, create hidden users, inject spam links or redirect visitors to scam pages.

The oldest technique is a brute force attack, where a bot tries large numbers of password guesses against a username, often “admin” or a name it scraped from your author archives. Security researchers have long explained why these work: weak or short passwords fall quickly when a script can try them without limits, and WordPress core does not cap failed login attempts by default.

The more effective technique today is credential stuffing. Instead of guessing, attackers take username and password pairs leaked from other breaches and try them on your site. OWASP’s page on credential stuffing describes it as one of the most common ways accounts are taken over, because so many people reuse passwords. If your editor uses the same password for WordPress and an old shopping account that was breached, the attacker may succeed on the first try.

Attackers also do not limit themselves to wp-login.php. WordPress has a second authentication endpoint, xmlrpc.php, which was built for remote publishing tools. It accepts a username and password with every request, and one of its methods lets a single request carry many login attempts. The table below summarizes the main attack types and what actually stops each one.

Attack TypeHow It WorksWhat Stops It
Brute forceGuesses many passwords against known usernamesLong unique passwords, attempt limits, server rate limiting
Credential stuffingReplays leaked username and password pairsTwo-factor authentication, unique passwords, breached-password checks
XML-RPC amplificationPacks many login attempts into one requestDisabling or restricting XML-RPC, server-level rules
Username enumerationFinds real usernames from author pages or the REST APIDifferent display names, fewer admins, 2FA so usernames matter less
Phishing for admin credentialsTricks a user into entering a password on a fake pagePhishing-resistant 2FA such as security keys or passkeys

Notice that no single row is solved by one tool. That is the core idea of a layered login defense, and it starts with the credential itself.

Start With Passwords That Cannot Be Guessed

Passwords are still the first layer, but the rules have changed. The current US federal guidance, NIST SP 800-63B, now says a password used as the only factor should be at least 15 characters long, that systems should not force arbitrary composition rules like “one symbol and one number,” and that passwords should only be changed when there is evidence of compromise. It also says new passwords should be checked against lists of known breached and common values, and that password managers and pasting must be allowed.

For a WordPress site, that translates into a few practical rules for everyone with a login, not only the owner:

  • Use a password manager. It generates long random passwords and remembers them, which removes the temptation to reuse one.
  • Make every WordPress password unique. Reuse is what makes credential stuffing work, so a password that exists nowhere else cannot be stuffed.
  • Prefer length over complexity. A long passphrase or a 20-character random string beats a short password full of symbols.
  • Never use “admin” or the site name as a username. These are the first guesses in every bot list.
  • Change passwords after any suspected leak, not on a calendar schedule that pushes people toward predictable patterns.

WordPress suggests a strong password when you create a user, but it still lets a determined user pick something weak, and a policy that only you follow is not a policy. That gap is the strongest argument for the next layer, which makes a stolen password far less useful.

Add Two-Factor Authentication

Two-factor authentication, often called 2FA or MFA, requires something in addition to the password, usually a code from an app, a physical security key or a passkey on your device. It is the single most effective defense against credential stuffing, because a leaked password alone no longer opens the door. WordPress core does not include 2FA, so it is added through a plugin, and several well-maintained options support authenticator apps, security keys and passkeys.

Not all second factors are equally strong. CISA’s guidance on requiring multifactor authentication ranks the common methods, and the ranking maps neatly onto WordPress plugins.

2FA MethodStrengthGood Fit For
Security key or passkeyStrongest, resists phishingAdministrators and anyone with full site access
Authenticator app with number matchingStrongTeams that already use push-based apps
Authenticator app with one-time codeGoodMost WordPress users, easy to roll out
Email or text message codeWeakestOnly when nothing better is possible

Make 2FA mandatory for administrators and editors at minimum, since those roles can publish content or change settings. Shop managers on WooCommerce sites belong on that list too. Store backup codes in your password manager. With strong credentials and a second factor in place, the remaining job is to stop bots from hammering the form in the first place.

Limit Login Attempts and Add a CAPTCHA

Out of the box, WordPress will happily process an unlimited number of failed logins. Limiting login attempts closes that gap by locking out an IP address or username after a set number of failures, for example five attempts in fifteen minutes, with longer lockouts for repeat offenders. This makes brute force impractical and slows credential stuffing.

A CAPTCHA or a less intrusive challenge such as a checkbox or invisible bot check adds a second filter. It makes automated scripts work harder and keeps a lot of junk traffic away from the password check. The trade-off is user friction and accessibility, so prefer a challenge that only appears when traffic looks suspicious rather than a puzzle on every login.

Both measures are usually added with a plugin, which is fine for small sites, but a plugin can only count attempts after WordPress has loaded. We return to that difference later. First, it is worth clearing up one of the most repeated pieces of login advice.

What Changing the Login URL Does and Does Not Do

Moving the login page from /wp-login.php to a custom address, such as /team-access/, is popular advice, and it does have a real benefit: it removes a huge amount of automated noise. Bots that only know the default path stop reaching your form, your logs get quieter and your server does less work. For a site that gets hammered by simple scanners, that is a genuine improvement.

What it does not do is make the login itself any stronger. It is security through obscurity, and it does nothing for XML-RPC or for a password that was already leaked. Treat a changed login URL as a noise filter on top of real protection, never as a replacement for strong passwords, 2FA and attempt limits.

Clean Up User Roles and Old Admin Accounts

Every account that can log in is part of your attack surface, and the more powerful the account, the bigger the risk. WordPress ships with a clear set of roles and capabilities, from Subscriber up to Administrator, and the principle of least privilege says each person should have the lowest role that lets them do their job. A content writer does not need to install plugins, so they should not be an administrator.

Over time, most sites collect accounts nobody remembers creating. A practical review, done at least every few months, looks like this:

  • List every administrator and confirm each one belongs to a current person who needs that level of access.
  • Remove or downgrade old accounts from former employees, past developers, freelancers and agencies, and reassign their content when deleting them.
  • Change display names so public author names do not match login usernames, which makes enumeration less useful.
  • Look for accounts you do not recognize, especially administrators created recently, since attackers often add a hidden admin after a break-in.
  • Turn off open registration under Settings unless the site genuinely needs public sign-ups, and check that the default role for new users is Subscriber.

A tidy user list also makes logs easier to read, because you can tell at once whether an account is legitimate. And the user profile screen is where the next, often overlooked, layer of login security lives.

Application Passwords and XML-RPC

Since WordPress 5.6, every user can create application passwords from their profile screen. These are 24-character generated passwords meant for tools and integrations, such as a mobile app, an automation service or a script that posts content through the REST API. According to the application passwords integration guide, they work for REST API and XML-RPC requests, cannot be used to log in through wp-login.php, and are only available by default on sites served over HTTPS.

The risk is that application passwords live outside your login form. Many 2FA and login-limit plugins only protect the form, so an application password that leaked from an old integration can keep working long after you enabled 2FA. Review each user’s application passwords on the Edit User screen, revoke anything unused, and if your site uses no integrations at all, a developer can disable the feature with the `wp_is_application_passwords_available` filter.

XML-RPC deserves the same scrutiny. The XML-RPC API predates the REST API and is still enabled by default for compatibility. Its `system.multicall` method allows many calls in one request, which is how attackers squeeze hundreds of password guesses past rules that count requests rather than attempts. Most modern sites do not need XML-RPC at all. If yours does not use the WordPress mobile app, an older publishing tool or a plugin that depends on it, block xmlrpc.php, ideally at the server so the request never reaches WordPress.

If you do need XML-RPC, restrict it rather than leaving it fully open. The WordPress guide to brute force attacks recommends rate limiting both wp-login.php and xmlrpc.php at the web server, allowing only known IP addresses where possible, and filtering with firewall rules. That recommendation points straight at the most important architectural decision in login security: where the protection runs.

Server-Level Protection vs Plugin Protection

Most login security advice is delivered as plugins, because plugins are easy to install. But a plugin runs inside WordPress, which means every malicious request still has to start PHP, load WordPress and often query the database before the plugin can say no. During a large attack, a site can slow down or fall over even though no password was ever guessed.

Server-level protection works one step earlier. Rules in the web server, a firewall in front of the site or a filtering layer on the host inspect each request and drop the bad ones before PHP runs. Rate limits on wp-login.php and xmlrpc.php, IP allowlists for the admin area and blocking of known malicious patterns all belong here.

AreaPlugin-Level ProtectionServer-Level Protection
Where it runsInside WordPress, after PHP loadsBefore PHP and WordPress load
Cost per blocked requestHigher, uses PHP and often the databaseLow, request is dropped early
Covers xmlrpc.phpOnly if the plugin hooks itYes, by path or pattern
Survives a broken WordPress installNoYes
Best at2FA, CAPTCHA, user-aware rulesRate limiting, bot filtering, allowlists

The answer is not one or the other. 2FA and user-aware rules belong in WordPress, because only WordPress knows who the user is. Volume control and bot filtering belong at the server, because that is where they are cheapest and hardest to bypass. A layered setup uses both, and our WordPress security checklist shows how the pieces fit together.

Logging and Alerts

None of these layers help much if nobody notices when they are tested or bypassed. Login logging records successful and failed logins, the username, IP address and time, and important account events such as new administrators, role changes or password resets. An activity log plugin covers events inside WordPress, while server access logs show the raw traffic hitting wp-login.php and xmlrpc.php, including the requests that never reached WordPress.

Logs only matter if someone reads them, so set up alerts for the events that should never happen quietly: a new administrator account, a successful login from an unexpected country, a burst of failed logins on a real username, or a change to a security setting. When an alert fires, the next section is the plan.

What to Do After a Suspected Breach

If you see an unknown admin, unexpected redirects or login alerts you cannot explain, assume compromise and act in a fixed order. The official FAQ for hacked WordPress sites recommends a similar sequence, and speed matters more than perfection in the first hour.

  • Take a full backup of the current state before changing anything, so you keep evidence and a fallback.
  • Change every administrator password and the hosting, database and SFTP passwords, using new unique values.
  • Revoke all application passwords and remove any unknown users, especially administrators.
  • Force logout of all sessions by updating the security keys and salts in wp-config.php.
  • Check for added files and code, such as unknown plugins, modified theme files and PHP files in the uploads folder.
  • Update WordPress core, plugins and themes, and remove anything abandoned or unused.
  • Restore from a clean backup if you cannot confidently remove every change, then reapply the password and key changes.
  • Turn on 2FA for every privileged account before reopening access.

Hidden backdoors often survive a password change, so do not stop there. Our step-by-step guide on how to fix a hacked WordPress site goes deeper into cleanup, and if the infection is spreading or you are short on time, a professional malware cleanup is usually faster than learning forensics mid-incident.

How Webueno Handles WordPress Login Security

At Webueno we treat the login page as part of the server, not only as a plugin setting. Our server-level protection, The Gatekeeper, filters requests at the server before PHP runs, which is the layer this guide recommends for volume control. On one site it stopped about 17,000 attacks in 23 days, with 33.9% of all requests stopped before PHP ran. You can read how it works on our WordPress security page.

The same stack includes a malware scanner that also checks inside zip files, and Sentinel AI explains each threat it finds so you understand what happened without a security background. Webueno hosting runs one site per DigitalOcean VPS, so a login flood on a neighbor’s site cannot drain your resources, and staging and live run on the same server with per-site PHP versions.

Around that, you choose what each site needs:

  • Uptime monitoring checks every 3 minutes and alerts after 3 failed pings.
  • Daily offsite backups of files, database and configuration are an optional add-on per site, which gives you a clean restore point after an incident.
  • Maintenance plans cost $10 per site for Monthly, $20 for Weekly and $60 for Daily.
  • Malware cleanup is available as a dedicated service if something does get through.

Hands-on work, such as a user and role audit, setting up 2FA or blocking XML-RPC, is done through tickets in the Webueno platform with tracked time. It is billed in credits, where 1 credit equals 1 hour at $42, and bundles save up to 21%, bringing the rate to $33.18 an hour. There are no contracts. Agencies get a white-label agency account and set their own margin, so login hardening for client sites becomes a service they can offer under their own brand.

Make the Login Page the Hardest Door

Securing the WordPress login is not about one clever setting. It is about stacking simple layers so that each one covers the gaps of the others: unique long passwords stop guessing, 2FA stops stolen passwords, attempt limits and server rules stop floods, a clean user list limits damage, and logs and alerts tell you when something slips through.

If you want the server-level layer, monitoring and backups handled for you, with help billed at a clear hourly rate, create your Webueno account and open a ticket for a login security review on any site you run.

Frequently Asked Questions

What Is the Most Important Step for WordPress Login Security?

Two-factor authentication for every administrator and editor gives the biggest improvement, because it stops attacks that use leaked or guessed passwords. Combine it with unique passwords from a password manager and attempt limits for a solid baseline.

Does Hiding the WordPress Login URL Make My Site Secure?

No. It reduces automated bot traffic and log noise, but it does not strengthen the login or protect XML-RPC. Use it as an extra filter on top of strong passwords, 2FA and attempt limits, not as your main defense.

Should I Disable XML-RPC on My WordPress Site?

If you do not use the WordPress mobile app, an older remote publishing tool or a plugin that needs it, yes. Blocking xmlrpc.php at the server removes an endpoint that attackers use to send many password guesses in a single request.

Can Application Passwords Bypass Two-Factor Authentication?

They can, because they authenticate REST API and XML-RPC requests without using the login form where many 2FA plugins work. Review application passwords on each user profile, revoke unused ones and disable the feature if no integration needs it.

Is a Login Security Plugin Enough on Its Own?

For a small, low-traffic site it is a reasonable start. During heavy attacks, though, every blocked request still loads PHP and WordPress, so server-level rate limiting and filtering protect performance far better. The strongest setup combines both.

What Should I Do First If I Think My Admin Account Was Hacked?

Take a backup of the current state, then change all administrator and hosting passwords, revoke application passwords, remove unknown users and update the security keys in wp-config.php to log everyone out. After that, scan for added files and backdoors or restore from a clean backup.

You may also like

Ready to Move Your Website and Business Forward?

No contracts. No unnecessary complexity. Just reliable execution and real results.