wp-login
A WordPress site’s login endpoint (/wp-login.php) is a common target for brute force attempts and bad actors. On WordPress VIP, brute force attempts on a site’s /wp-login.php are detected and mitigated at the edge (i.e., firewall, NGINX). Dynamic security protocols are in place that can be triggered by unusual behavioral patterns to protect against unauthorized access and abuse of the login endpoint. An automated attack will trigger VIP’s dynamic security measures, and login attempts will be completely blocked.
Caution
Attempts to obfuscate the WordPress login page by altering the URL—via a plugin or otherwise—will remove VIP’s brute force login protections from the /wp-login.php endpoint.
Additional security measures are in place to protect the login endpoint for WordPress sites on the WPVIP Platform:
- The username
adminis disallowed for WordPress sites. Attempts to log in with theadminusername will be blocked and the noticeLogins are restricted for that user. Please try a different user account.will be displayed. - On a new WordPress environment, Two-Factor Authentication (2FA) is enforced for all users that have an Editor, Administrator, or Super Admin (WordPress multisite) role. As a security recommendation, 2FA should be required for all user roles regardless of capabilities. 2FA can be enforced for additional user roles in the Enforce Two-Factor Authentication module of WordPress Security Controls.
Note
Frequent user lockouts can occur if a site is behind a reverse proxy that is not correctly configured to send the original IP address of the end user in an HTTP header.
Modify the allowed number of failed login attempts
Rate limiting is in place (e.g. 5 failed attempts within 5 minutes) for requests that are made to a WordPress site’s login endpoint ( /wp-login.php).
Underlying code in VIP MU plugins protects the login endpoint by tracking the rate of incoming requests for either:
- An IP address
- A username
- Or an IP address + username combination
When the threshold for failed login attempts is exceeded based on one of the above criteria, the IP address and/or username will be blocked from making further login attempts.
The allowed number of failed login attempts for a site can be modified with the VIP MU plugin filters wpcom_vip_ip_login_threshold and wpcom_vip_ip_username_login_threshold.
Custom code that uses these filters should be added to a file located within /client-mu-plugins.
For IP address
Modify the number of failed login attempts allowed for an IP address with the wpcom_vip_ip_login_threshold filter.
In this code example, the threshold limit for failed login attempts is set to 10:
add_filter( 'wpcom_vip_ip_login_threshold', function() {
return 10;
} );IP address + username combination
Modify the number of failed login attempts to allow for an IP address + username combination with the wpcom_vip_ip_username_login_threshold filter.
In this code example, the threshold limit is set to 1 for the number of failed login attempts by the usernames exampleuserone and exampleusertwo:
add_filter( 'wpcom_vip_ip_username_login_threshold', function( $threshold, $ip, $username ) {
if ( 'exampleuserone' === $username || 'exampleusertwo' === $username ) {
$threshold = 1;
}
return $threshold;
}, 10, 3 );Clear a lockout for a locked out user
Prerequisite
VIP-CLI is installed and has been updated to the most current version.
When a login rate limit threshold has been exceeded, a lockout value is set in the vip_login_limit cache group for the IP address, username, or IP address + username combination that exceeded the limit. A separate counter tracks the number of recent failed login attempts for each of these.
If a user receives the warning message You have exceeded the login limit. Please wait a few minutes and try again. after they attempt to log in to a site, a lockout is in place. The user will be unable to log in to the site until either the lockout time has expired or the lockout has been cleared.
Lockouts are cleared with the wp vip security unban WP-CLI commands, run with VIP-CLI. Each command removes both the lockout value and the failed login attempt counter, so the user starts again with no recorded failed attempts. The commands also clear password reset lockouts, which display the message You have exceeded the password reset limit. Please wait a few minutes and try again.
To clear a lockout:
- Collect the username and IP address of the locked out user. A user can retrieve their IP address by visiting WordPress.com’s “whatismyip”.
- Use VIP-CLI to run the WP-CLI command
wp vip security unban user <user> <ip>, where<user>is the username and<ip>is the user’s IP address. This clears the username, IP address, and IP address + username lockouts and counters in a single command.
$ vip @example-app.production -- wp vip security unban user exampleuser 1.2.3.4
===================================
+ command: wp vip security unban user exampleuser 1.2.3.4
===================================
✔ Are you sure you want to run this command on PRODUCTION for site example-app? (y/N) · true
Success: Unbanned user exampleuser for IP 1.2.3.4
Success: Unbanned user exampleuserClearing the lockout for an IP address applies to every user who logs in from that IP address, not only to the user named in the command.
If a site is behind a reverse proxy that is not configured to send the original IP address of the end user, lockouts are recorded against the reverse proxy’s IP address instead of the user’s IP address. In that case, the IP address supplied by the user will not match the lockout. Correcting the configuration as described in Configure a reverse proxy prevents these lockouts from recurring.
Unbanning an IP address
To clear lockouts for one or more IP addresses without naming a user, run wp vip security unban ip with each IP address separated by a space. Both IPv4 and IPv6 addresses are accepted.
$ vip @example-app.production -- wp vip security unban ip 1.2.3.4 5.6.7.8
===================================
+ command: wp vip security unban ip 1.2.3.4 5.6.7.8
===================================
✔ Are you sure you want to run this command on PRODUCTION for site example-app? (y/N) · true
Success: Unbanned IP 1.2.3.4
Success: Unbanned IP 5.6.7.8An invalid IP address is skipped with the warning Warning: Invalid IP address: <ip>, and the remaining IP addresses are still processed.
Unbanning a user
The user can be identified by username, email address, or user ID. When no IP address is included, the command clears only the username lockout and counter.
$ vip @example-app.production -- wp vip security unban user exampleuser
===================================
+ command: wp vip security unban user exampleuser
===================================
✔ Are you sure you want to run this command on PRODUCTION for site example-app? (y/N) · true
Success: Unbanned user exampleuserIf no matching user is found, the command returns Error: User not found: <user> and makes no changes.
Multisite
To clear a lockout for a user locked out of a network site on a multisite environment, the wp vip security unban commands must target that specific site. Use the --url parameter to target the site by domain (e.g. --url=example.com). If a network site is not targeted by the WP-CLI command, the command will be run against the main site, typically ID 1.
$ vip @example-app.production -- wp vip security unban user exampleuser 1.2.3.4 --url=example.comLast updated: November 13, 2026