{
    "title": "How to limit login attempts on WordPress: thresholds, durations and pitfalls",
    "seo_title": "How to limit login attempts on WordPress",
    "h1": "How to limit login attempts on WordPress: thresholds, durations and pitfalls",
    "description": "Threshold, duration, counting by IP or by account, proxies and shared IPs: set up WordPress login limiting without locking out your users.",
    "lead": "Blocking an address after a few failures looks simple. In practice, the threshold, the duration, proxies like Cloudflare and shared addresses decide whether the protection stops bots or your customers.",
    "language": "en",
    "locale": "en-US",
    "type": "article",
    "url": "https://www.wp-feint.com/limit-login-attempts-wordpress/",
    "canonical": "https://www.wp-feint.com/limit-login-attempts-wordpress/",
    "markdown": "https://www.wp-feint.com/limit-login-attempts-wordpress/index.md",
    "json": "https://www.wp-feint.com/limit-login-attempts-wordpress/index.json",
    "published": "2026-08-20T07:00:00+00:00",
    "modified": "2026-11-22T12:09:16+00:00",
    "site": {
        "name": "WP Feint",
        "url": "https://www.wp-feint.com/"
    },
    "translations": [
        {
            "language": "en",
            "hreflang": "en-US",
            "title": "How to limit login attempts on WordPress: thresholds, durations and pitfalls",
            "url": "https://www.wp-feint.com/limit-login-attempts-wordpress/",
            "markdown": "https://www.wp-feint.com/limit-login-attempts-wordpress/index.md",
            "json": "https://www.wp-feint.com/limit-login-attempts-wordpress/index.json"
        },
        {
            "language": "fr",
            "hreflang": "fr-FR",
            "title": "Comment limiter les tentatives de connexion sur WordPress : seuils, durées et pièges",
            "url": "https://www.wp-feint.com/fr/limiter-tentatives-connexion/",
            "markdown": "https://www.wp-feint.com/fr/limiter-tentatives-connexion/index.md",
            "json": "https://www.wp-feint.com/fr/limiter-tentatives-connexion/index.json"
        },
        {
            "language": "es",
            "hreflang": "es-ES",
            "title": "Cómo limitar los intentos de acceso en WordPress: umbrales, duraciones y trampas",
            "url": "https://www.wp-feint.com/es/limitar-intentos-acceso-wordpress/",
            "markdown": "https://www.wp-feint.com/es/limitar-intentos-acceso-wordpress/index.md",
            "json": "https://www.wp-feint.com/es/limitar-intentos-acceso-wordpress/index.json"
        },
        {
            "language": "de",
            "hreflang": "de-DE",
            "title": "So begrenzt du Anmeldeversuche in WordPress: Schwellenwerte, Sperrdauer und Fallen",
            "url": "https://www.wp-feint.com/de/wordpress-anmeldeversuche-begrenzen/",
            "markdown": "https://www.wp-feint.com/de/wordpress-anmeldeversuche-begrenzen/index.md",
            "json": "https://www.wp-feint.com/de/wordpress-anmeldeversuche-begrenzen/index.json"
        },
        {
            "language": "it",
            "hreflang": "it-IT",
            "title": "Come limitare i tentativi di accesso su WordPress: soglie, durate e trappole",
            "url": "https://www.wp-feint.com/it/limitare-tentativi-accesso-wordpress/",
            "markdown": "https://www.wp-feint.com/it/limitare-tentativi-accesso-wordpress/index.md",
            "json": "https://www.wp-feint.com/it/limitare-tentativi-accesso-wordpress/index.json"
        },
        {
            "language": "pt",
            "hreflang": "pt-BR",
            "title": "Como limitar as tentativas de login no WordPress: limites, durações e armadilhas",
            "url": "https://www.wp-feint.com/pt/limitar-tentativas-login-wordpress/",
            "markdown": "https://www.wp-feint.com/pt/limitar-tentativas-login-wordpress/index.md",
            "json": "https://www.wp-feint.com/pt/limitar-tentativas-login-wordpress/index.json"
        },
        {
            "language": "nl",
            "hreflang": "nl-NL",
            "title": "Zo beperk je inlogpogingen in WordPress: drempels, duur en valkuilen",
            "url": "https://www.wp-feint.com/nl/inlogpogingen-beperken-wordpress/",
            "markdown": "https://www.wp-feint.com/nl/inlogpogingen-beperken-wordpress/index.md",
            "json": "https://www.wp-feint.com/nl/inlogpogingen-beperken-wordpress/index.json"
        }
    ],
    "headings": [
        {
            "level": 1,
            "text": "How to limit login attempts on WordPress: thresholds, durations and pitfalls"
        },
        {
            "level": 2,
            "text": "The principle and its three settings"
        },
        {
            "level": 3,
            "text": "Which numbers to pick"
        },
        {
            "level": 2,
            "text": "Count by IP address or by account?"
        },
        {
            "level": 2,
            "text": "The proxy and CDN trap"
        },
        {
            "level": 2,
            "text": "Shared addresses"
        },
        {
            "level": 2,
            "text": "False positives: what to expect"
        },
        {
            "level": 2,
            "text": "With WP Feint"
        },
        {
            "level": 3,
            "text": "Key takeaways"
        },
        {
            "level": 2,
            "text": "Sources"
        }
    ],
    "body": "WordPress puts no limit on the number of password attempts: a bot can try as many as the server will accept. Limiting attempts is therefore one of the first protections people add to a site. Configured badly, though, it locks out your own users, or blocks nothing at all behind a [CDN](https://www.wp-feint.com/glossary/cdn/). Here are the settings that matter and the most common pitfalls.\n\nQuick definition: [Brute-force attack](https://www.wp-feint.com/glossary/brute-force-attack/). Ready-made solution: [WordPress brute force protection with WP Feint](https://www.wp-feint.com/features/login-attempt-limiting/).\n\n## The principle and its three settings\n\nThe OWASP Authentication Cheat Sheet describes three parameters:\n\n- the **threshold**: the number of failures allowed;\n- the **observation window**: the period during which those failures are counted;\n- the **lockout duration**: how long login stays refused once the threshold is reached.\n\nSome applications use an **exponential lockout**: a very short duration at first, which doubles with each new lockout. It barely bothers a human who makes two mistakes, but slows a bot down considerably.\n\n![Diagram of a counting window: five failures in orange, the sixth triggers a lockout of the address](https://www.wp-feint.com/media/2026/10/seuil-fenetre-duree-en.webp)\n\n### Which numbers to pick\n\nThere is no universal official value. The available reference points:\n\n- NIST (SP 800-63B-4) requires verifiers to limit consecutive failed attempts on a single authenticator to **no more than 100**, noting that this is an upper bound and that lower limits are possible;\n- OWASP stresses the balance between protection and the risk of locking out legitimate users;\n- for comparison, WP Feint Pro allows 8 failures by default, then blocks the address for 15 minutes.\n\n| Type of site | Threshold | Lockout duration | Note |\n| --- | --- | --- | --- |\n| Brochure site, one or two administrators | 5 to 8 failures in 15 minutes | 15 to 60 minutes | Few false positives likely |\n| Multi-author editorial site | 8 to 10 failures | 15 to 30 minutes | Plan for unlocking by an administrator |\n| Store or member area | 10 to 20 failures | 5 to 15 minutes, exponential | Customers often forget their password |\n| Any site | Two-factor authentication for administrators | Not applicable | Makes the threshold less critical |\n\n*A reasonable starting point by type of site (adjust based on your logs)*\n\nThese values are an editorial starting point, not a standard: look at how many legitimate failures show up in your logs before tightening.\n\n## Count by IP address or by account?\n\nThis is the most important choice, and each option has a weakness.\n\n| Method | What it stops | Its weak spot |\n| --- | --- | --- |\n| By IP address | A bot that keeps trying from the same address | A botnet changes addresses; a shared address blocks innocent users |\n| By account (username) | Attempts spread over thousands of addresses against the same account | A stranger can deliberately lock out a legitimate user |\n| Both, with two-factor authentication | The vast majority of cases | Slightly more complex settings |\n\n*The two ways to count*\n\nOWASP recommends tying the counter to the **account** to counter attacks coming from many addresses, while warning about the opposite risk: letting an attacker lock out other users. It suggests, for example, keeping the \"Forgot password\" link working even when an account is locked.\n\nMost WordPress plugins count by IP address. That works well against persistent bots, but as the WordPress documentation points out, these attacks often come from botnets, and therefore from a very large number of addresses. Wordfence's 2024 report mentions nearly 136 million distinct addresses behind password attacks during the year. Most general security plugins also include login limiting: our [comparison of the best WordPress security plugins](https://www.wp-feint.com/best-wordpress-security-plugins/) shows which ones.\n\n## The proxy and CDN trap\n\nWhen a CDN such as Cloudflare sits in front of your site, it is no longer the visitor who connects to your server, it is the CDN. As far as PHP is concerned, the connection address (`REMOTE_ADDR`) is then the CDN's.\n\n![Diagram: a visitor and a bot both go through a CDN; without restoring the real address, the server sees the CDN address for everyone and a lockout hits everyone](https://www.wp-feint.com/media/2026/10/proxy-adresse-en.webp)\n\nTwo opposite mistakes are possible:\n\n- **counting the CDN address**: every visitor seems to come from a handful of addresses. A bot's failures then lock out your users, or the lockout is so broad that it becomes unusable;\n- **trusting the `X-Forwarded-For` header without verification**: this header is sent by the client and can be forged. A bot that sends a different address with each request escapes any counting.\n\nThe right approach is to **restore the real address at the server level**. Cloudflare documents this setup: the `mod_remoteip` module for [Apache](https://www.wp-feint.com/glossary/apache-http-server/) with the `CF-Connecting-IP` header, or the `realip` module for [Nginx](https://www.wp-feint.com/glossary/nginx/), declaring only Cloudflare's address ranges as trusted proxies. Cloudflare notes that these ranges change and must be kept up to date. Once that is done, `REMOTE_ADDR` contains the visitor's address and every plugin benefits.\n\n## Shared addresses\n\nEven without a CDN, an IP address does not always map to one person.\n\n- **Corporate networks, schools, public Wi-Fi**: dozens or hundreds of people go out through the same address.\n- **Mobile carriers**: many use carrier-grade NAT (CGN), for which the IETF reserved a dedicated address block (RFC 6598). The same customer can change addresses and share theirs with other subscribers.\n- **IPv6**: a subscriber usually receives a whole block of addresses (RFC 6177 recommends assigning each site at least a /64, and often much more). Counting address by address in IPv6 lets a bot try thousands of them without ever reaching the threshold; counting by prefix makes more sense.\n\nIn practice: keep a list of trusted addresses for your offices, never block an address permanently, and provide a simple way for an administrator to unlock themselves.\n\n## False positives: what to expect\n\n- A user who changed their password and whose browser or mobile app keeps resending the old one.\n- An application or service that connects to XML-RPC or the REST API with an expired password.\n- A store customer who tries all of their usual passwords.\n- An administrator behind the same address as an infected machine on the network.\n\nIn each case, two-factor authentication and application passwords reduce the need for a very low threshold.\n\n## With WP Feint\n\nWP Feint Pro includes [login attempt limiting](https://www.wp-feint.com/features/login-attempt-limiting/) by network address: 8 failures allowed by default, adjustable from 3 to 30, with a lockout duration of 15 minutes by default, adjustable from 1 to 60. A successful login resets the counter, and the troubleshooting tab lets you unlock your own address. The plugin counts the server's connection address and never trusts an `X-Forwarded-For` header sent by the client: behind a CDN, the real address must therefore be restored at the server level, as described above. [Two-factor authentication](https://www.wp-feint.com/features/two-factor-authentication/) failures also count toward this limit. Its guide is explicit: this is neither network traffic rate limiting nor a sufficient defense on its own against a distributed attack.\n\n*Setting up login attempt limiting on WordPress with a plugin.*\n\n### Key takeaways\n\n- WordPress does not limit login attempts out of the box.\n- Set three parameters: threshold, observation window and lockout duration; favor short or exponential lockouts.\n- Behind Cloudflare or another CDN, restore the real address at the server level and never trust `X-Forwarded-For` without verification.\n- An IP address can be shared by hundreds of people; in IPv6, count by prefix.\n- Limiting slows bots down; two-factor authentication protects the account.\n\n## Sources\n\n- [OWASP: Authentication Cheat Sheet (Account Lockout)](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)\n- [NIST SP 800-63B-4: Authentication and Authenticator Management (rate limiting)](https://pages.nist.gov/800-63-4/sp800-63b.html)\n- [WordPress Developer Resources: Brute Force Attacks](https://developer.wordpress.org/advanced-administration/security/brute-force/)\n- [Cloudflare: Restoring original visitor IPs](https://developers.cloudflare.com/support/troubleshooting/restoring-visitor-ips/restoring-original-visitor-ips/)\n\nOther sources consulted: official documentation and Wordfence database.",
    "categories": [
        "Attacks and brute force"
    ],
    "format": "application/json"
}