Security 5 min read

How to stop brute force attacks on WordPress

How to stop brute force and credential stuffing attacks on WordPress: login limits, 2FA, CAPTCHA, XML-RPC, firewall rules, rate limiting and monitoring login attempts.

Usman Muhammad UsmanUpdated October 13, 2026
How to stop brute force attacks on WordPress

Brute force attacks try to guess logins by submitting huge numbers of username and password combinations. Credential stuffing uses passwords leaked from other websites. Both target wp-login.php, XML-RPC and WooCommerce account pages around the clock. They waste server resources and occasionally succeed. Here are the layers I use to stop them.

How brute force attacks work

Bots try common usernames such as admin with lists of common passwords, or combinations from previous breaches. Distributed attacks spread attempts across thousands of IP addresses, making simple IP blocking less effective. Some target XML-RPC, which can test many passwords in a single request.

Even unsuccessful attacks consume CPU and database resources, slowing the site for real visitors, especially on shared hosting.

Strong passwords and unique usernames

The most basic defence is a password that cannot be guessed: long, unique and generated by a password manager. Avoid usernames such as admin or your business name, and make sure display names differ from login names.

See password managers for small teams.

Brute force defence layers
  1. 1Strong passwordsUnique usernames
  2. 22FAPrivileged users
  3. 3Login limitsLockouts
  4. 4XML-RPCDisable if unused
  5. 5Edge rulesChallenge and rate limit

Two-factor authentication

With two-factor authentication, a correct password is not enough to log in. This makes brute force and credential stuffing attacks almost useless against protected accounts. Enable it for every administrator, editor and shop manager.

See securing WordPress logins.

Limit login attempts

Limit how many failed attempts an IP address can make before being locked out temporarily, with longer lockouts for repeat offenders. Security plugins such as Wordfence, Solid Security and dedicated login limit plugins provide this.

Set limits that allow for genuine mistakes, such as five attempts, and make sure your own IP is not easily locked out.

Disable or protect XML-RPC

XML-RPC allows remote publishing and is used by the WordPress mobile app and Jetpack, but it is also a popular brute force target because one request can test many passwords. If you do not use it, disable it with a plugin, server rule or firewall.

See XML-RPC and WordPress security.

CAPTCHA on login

Adding Cloudflare Turnstile or reCAPTCHA to login, registration and password reset forms blocks many automated attempts. Invisible options keep the experience smooth for real users.

Test with WooCommerce account and checkout login forms, which may need separate integration.

Firewall and edge rules

Firewall rules can challenge or block traffic to wp-login.php and xmlrpc.php before it reaches WordPress. With Cloudflare, you can challenge login access from countries you do not serve or rate limit login requests. Edge blocking saves server resources.

See do you need a WAF.

Restrict wp-admin access

If your team logs in from fixed locations, restrict wp-admin and wp-login.php to known IP addresses at the server or firewall level. This blocks attackers completely but is impractical for teams who work from many places.

A password-protected directory in front of wp-admin is another option, though it can interfere with some plugins that use admin-ajax.php.

Change the login URL

Moving the login page to a custom address removes most automated attempts against wp-login.php, which reduces noise and server load. It is not strong security by itself but works well alongside other layers.

See should you change the WordPress login URL.

Protect customer logins

WooCommerce and membership sites have customer login forms that attackers use for credential stuffing. Rate limit these endpoints, add CAPTCHA where needed and alert on unusual spikes in failed logins.

See WooCommerce security basics.

Monitor login activity

An activity log or security plugin shows failed and successful logins, locked-out IPs and login sources. Alerts for administrator logins from new locations help detect compromised accounts. Review logs after spikes.

See WordPress activity logs.

If an account is compromised

If you see successful logins you do not recognise, change the password immediately, enable 2FA, log out all sessions by updating security keys, check for new users and plugins and scan for malware.

See what to do when your WordPress site is hacked.

Application passwords and API access

WordPress supports application passwords for integrations that use the REST API, such as some mobile apps and automation tools. They are separate from your main password and can be revoked individually. Review them under each user’s profile and remove any you do not recognise or no longer use.

Attackers who obtain an application password can access the site without triggering normal login protections. Treat them like any other credential: create one per integration, name it clearly and revoke it when the integration ends.

Hosting-level protection

Many hosts block brute force attempts across all their servers using shared intelligence, so an IP attacking one site is blocked everywhere. Ask your host what login protection they provide, as it may reduce the need for heavy security plugins.

Server-level blocking also protects against attacks on other services, such as SFTP and the control panel login, which WordPress plugins cannot cover. See choosing WordPress hosting.

Getting help

Login protection, firewall rules and monitoring are part of my website protection service. For the full set of measures, follow my security hardening checklist.

For larger floods of traffic, see DDoS protection for small business websites.

Key takeaways

  • Strong unique passwords and 2FA make brute force attacks ineffective.
  • Limit login attempts and disable XML-RPC if you do not use it.
  • Use firewall rules to challenge login traffic before it reaches WordPress.
  • Monitor logins and act quickly on unrecognised successful logins.

Frequently asked questions

What is a brute force attack?

Repeated attempts to guess login details by trying many combinations.

What is credential stuffing?

Using usernames and passwords leaked from other sites to log in.

Does limiting login attempts stop distributed attacks?

Partly. Combine it with 2FA, CAPTCHA and firewall rules.

Should I disable XML-RPC?

If you do not use the mobile app, Jetpack or remote publishing, yes.

Can brute force attacks slow my site?

Yes. Blocking them at the edge saves server resources.

How do I see login attempts?

Use a security plugin or activity log that records failed and successful logins.

Do I need a plugin to limit logins?

Many security plugins include it, and some hosts block repeated failures at the server. One layer is usually enough.

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.