---
title: How to block a country
canonical: https://wpsecurityninja.com/docs/firewall/how-to-block-a-country/
---
Country blocking (Pro) stops visitors whose IP maps to countries you select. Useful when abuse concentrates in regions you do not serve.

Cloud Firewall must be enabled. The control is on **Security Ninja → Firewall → Settings**.

> Be careful blocking the United States. Many Googlebot crawls come from US IPs. Blocking the USA can hurt search indexing.

## Steps

1. Go to **Security Ninja → Firewall → Settings**.
2. Find **Block visits from these countries**.
3. Search or scroll to select countries. Remove a country with the **x** next to its name.
4. Use **Select All** / **Select None** for bulk changes when available.
5. Save settings.

![Block visits from specific countries](https://wpsecurityninja.com/media/2019/07/how-to-block-visits-from-specific-countries.webp)

## How it works

Visitor IPs are looked up with **IP2Location LITE** data stored on your site. Matching countries are blocked. Country rules use the same visitor IP as bans and logging, so if lookups look wrong behind Cloudflare or a proxy, set [Visitor IP detection](https://wpsecurityninja.com/docs/firewall/visitor-ip-detection/) first.

You can [show a message or redirect blocked visitors](https://wpsecurityninja.com/docs/firewall/block-or-redirect-visitors/).

> This product includes IP2Location LITE data available from [https://lite.ip2location.com](https://lite.ip2location.com/).

## Limitations

VPNs and proxies can make a visitor appear to be in another country. Treat country blocking as one layer. Combine it with [firewall rules](https://wpsecurityninja.com/docs/firewall/how-to-use-the-firewall/), login protection, and [security tests](https://wpsecurityninja.com/docs/security-tests/).

## Related

* [Block or redirect visitors](https://wpsecurityninja.com/docs/firewall/block-or-redirect-visitors/)
* [How to use the firewall](https://wpsecurityninja.com/docs/firewall/how-to-use-the-firewall/)
* [Visitor IP detection](https://wpsecurityninja.com/docs/firewall/visitor-ip-detection/)
