IP blocklist and whitelist (IPv4, IPv6 and CIDR)
Shield has two lists you control yourself. The blocklist is for IPs you never want to sign in. The whitelist is for IPs you always trust. Both are on the Lockout tab, and both accept single addresses and ranges, for IPv4 and IPv6.

The blocklist
IPs on the blocklist are permanently blocked from signing in. There are no attempts to count and no timer. A blocked visitor sees the message “Too many failed login attempts. Please try again later.” Blocked attempts are written to the event log as an ip_block event, at most once per IP per minute.
How to add IPs
- Open Settings → Login Shield → Lockout.
- In the Blocked IPs box, enter one IP or range per line.
- Click Save lockout settings.
Lines that start with # are treated as comments and ignored, so you can leave yourself notes:
# Scanner that kept hitting us
198.51.100.23
# A whole network
203.0.113.0/24
2001:db8:abcd::/48 Blocking from the log. In the Log tab, each IP that isn’t currently locked out has a Block button. Click it and confirm, and Shield adds the IP to the blocklist for you. If the IP was locked out at that moment, its temporary lockout is removed, because it’s now blocked for good.
Removing an IP. Delete its line from the Blocked IPs box and save.
The whitelist
IPs on the whitelist are never locked out. Shield doesn’t count their failed attempts, and it skips the other checks that could stop them, such as honeypot lockouts, geo-blocking and the early-block rate limit. A whitelisted IP also can’t be blocked by the blocklist. If an IP is on both lists, the whitelist wins.
How to add IPs
- Open Settings → Login Shield → Lockout.
- In the Whitelisted IPs box, enter one IP or range per line. (Commas and spaces also work.)
- Click Save lockout settings.
By default the list contains 127.0.0.1 and ::1, which is your server talking to itself. Leave them in place, because WordPress scheduled tasks and health checks come from there.
Who to whitelist
Use the whitelist sparingly, and only for addresses you control and trust:
- Your own office or home IP, so you can’t lock yourself out
- Your server’s own IP, or a monitoring service you rely on
- A shared office or school IP, if many legitimate users sign in from it
Whitelisting a shared IP also means an attacker on that network is never locked out. Don’t whitelist large ranges you don’t control.
Many home and mobile connections get a new IP now and then. If yours changes, update the whitelist, or use the wp-config.php bypass in “I locked myself out”.
How to write IPs and ranges
A single IP. Write the address on its own line:
203.0.113.10
2001:db8::1 A range (CIDR). Write the starting address, a slash and the size of the range:
203.0.113.0/24
10.0.0.0/8
2001:db8::/32 The number after the slash is how many leading bits of the address are fixed. A smaller number covers more addresses. For example, 203.0.113.0/24 covers all 256 addresses from 203.0.113.0 to 203.0.113.255, and 203.0.113.0/16 covers 65,536. You can use a CIDR calculator online if you’re not sure.
Not supported. The lists don’t take domain names, wildcards such as 203.0.113.*, or ranges written as 1.2.3.4-1.2.3.9. Use CIDR notation instead.
Tips
- Find your own IP by searching “what is my IP” in your browser.
- Don’t block your own IP. The Block button asks you to confirm, but it doesn’t check whether the address is yours. If you do, remove it from the list, or use the bypass in “I locked myself out”.
- Behind a CDN or proxy? Shield needs your CDN’s real visitor IP to match these lists. Turn on Trust proxy headers on the same tab. See “Set attempt limits and lockout times”.
- Blocking whole countries is easier with geo-blocking than with long lists of ranges. See “Block countries and whitelist IPs”.
- A temporary pause. To exempt your own IP only from your wp-config.php file, you can use the
NAHNLS_BYPASS_IPconstant instead. It works like the whitelist.
Was this helpful?
Thanks for your feedback!
✓ Feedback received. Thank you!