Skip to content

How to Block Countries (Pro)

Most fake signups and card-testing runs come from a handful of countries you never ship to. Country rules refuse them before the CAPTCHA is looked at.

The plugin needs to know each visitor’s country:

  • Behind Cloudflare, it reads Cloudflare’s country header. Nothing to set up.
  • Otherwise, it uses WooCommerce geolocation, which needs a free MaxMind license key under WooCommerce → Settings → Integration.

A visitor whose country cannot be found is let through.

Go to Configuration → Bot Defense. Under Country rules, set Mode:

  • Block the listed countries: refuse visitors from the countries you pick.
  • Allow only the listed countries: refuse everyone except the countries you pick.

Type in Countries to search, and add each one. Click Save Changes.

Country rules blocking three countries

Allow only is strict: a customer travelling abroad is refused too. Block is the safer start.

The Country Rules panel on the Firewall screen sums up the rule in one line. Edit returns to the Bot Defense tab.

The Country Rules panel on the Firewall

A visitor from a refused country still sees the form. When they submit it, they get the Lockout message and the form is not processed. The log reads Blocked, “Country not allowed”.

The My Account login refusing a visitor from a blocked country

On the demo store, the rule blocked the tester’s own country, and their next login was refused this way.

  • Only protected forms are affected. Visitors from a refused country can still browse the shop. Protect checkout to stop them buying.
  • Trusted IPs and roles are never refused.
  • To undo it, set Mode back to Off and save.