IP and country blocking

WordPress IP Blocking Plugin: Addresses, Ranges and Countries

To block an IP address in WordPress with WP SecureGate, add it to the firewall's block list and it is refused from then on, whatever mode the firewall is in. The same plugin handles the rest of IP blocking: an allow list for addresses that must never be stopped, country rules, and automatic blocks for addresses that guess passwords or attack the site.

See plans & pricingAll features
  • ✓ Single IPs or CIDR ranges
  • ✓ Country rules off by default
  • ✓ Allow list protects your team

Block and allow lists you control

The block list is a deliberate decision, so it doesn't wait for Block mode. A listed address is refused even while the firewall is only monitoring. The allow list works the other way: an allowlisted address is never inspected by the firewall at all.

Both lists take single addresses or CIDR ranges, so an office network or a VPN can go in as one line. An entry written in IPv4-mapped form, such as ::ffff:1.2.3.4, matches its plain IPv4 spelling too.

Needs setup. Both lists start empty.

Why you should allowlist your own addresses

Put your office, your VPN and any fixed address your team works from on the allow list before you tighten anything else. An allowlisted address is skipped by the firewall rules, exempt from the sign-in lockout (including the lock on a single account), never given an attacker score and never reported to the network list.

That protects you from the one false positive that hurts most: your own team shut out mid-task. If it happens anyway, an emergency sign-in link can be emailed to administrator addresses, and the WPSG_FIREWALL_OFF constant turns the firewall off. More recovery options are on the login security page.

  • Firewall rules: never inspected.
  • Sign-in lockout: exempt.
  • Attacker scoring: never scored.
  • Network learning: never reported.

Needs setup. Add your own addresses to the allow list.

Country blocking for WordPress

Country blocking has two modes. A block list refuses the countries you name. An allow list refuses every country you didn't name, which is stricter, so check where your team travels and which outside services call your site before you choose it.

Countries are looked up in a DB-IP country database that is signed, refreshed monthly and downloaded with your licence. Jetpack and WordPress.com addresses are exempt from country rules, so those services keep working.

Country rules cut noise from places you don't serve. They don't stop a determined attacker, who can send traffic from any country.

Off by default. Needs a licence for the country database.

Automatic blocks

Some addresses block themselves by how they behave. The sign-in lockout stops password guessing: 5 failed tries in 15 minutes gives a 15-minute lockout, and 20 gives a 24-hour lock. Attack usernames such as admin or root that aren't real accounts are locked on the first try. The details are on brute force protection.

In Block mode, attacker scoring blocks an address for an hour once it reaches 20 points from at least 2 kinds of bad behaviour. Auto-block, a separate option, temporarily shuts out an address that keeps tripping the firewall.

The lockout is on by default. Attacker scoring is on for new installs. Auto-block is off by default and takes effect only in Block mode.

The signed attacker list

You don't have to find every bad address yourself. A signed list of known attacker addresses is downloaded daily and checked with Ed25519 before use. In Block mode, addresses from public threat feeds are refused. Also in Block mode, addresses that only other WP SecureGate sites reported are refused on sign-in, registration, password reset and a few other sensitive targets, not on ordinary page views.

How the list is built and where each kind of listing applies is covered on the WordPress firewall plugin page.

On by default. Needs an active licence.

Part of WP SecureGate: Firewall →

Related protection

FirewallA web application firewall that runs before your theme, refuses critical attacks and learns your team's work first.Brute-force protectionLogin lockouts per address and per account, instant locks on fake admin usernames, and XML-RPC off by default.Monitoring and alertsLive traffic, a weekly summary and opt-in email alerts that say who, from where and on what device.Login securityLockouts, a custom login URL, password checks and 2FA, with a way back in if you ever lock yourself out.

Questions about ip blocking

Add the address to the firewall's block list. It's refused from then on in both Monitor and Block mode. You can enter a single address or a CIDR range.

Yes. Country blocking can refuse a list of countries or allow only the ones you pick. It is off by default and uses a signed DB-IP database that is refreshed monthly. Jetpack and WordPress.com are never blocked by country rules.

Allowlist your own addresses first, because an allowlisted address is never inspected by the firewall. If you are shut out anyway, the WPSG_FIREWALL_OFF constant in wp-config.php turns the firewall off, and WPSG_SAFE_MODE lifts the sign-in rules and lockout.

Not on its own. Attackers can route traffic through almost any country, so a WordPress geo blocking rule mostly removes background noise from places you don't serve. The firewall rules, the lockout and the attacker list do the real work.

Every feature, in every plan

One licence covers the firewall, malware scanner, login protection, WooCommerce checkout protection and everything else. Plans differ only in the number of sites, and every charge has a 7-day refund.

Choose a planAsk a question