---
title: How to blacklist an IP
canonical: https://wpsecurityninja.com/docs/firewall/how-to-blacklist-an-ip/
---
Manually block or allow specific IPs from **Security Ninja → Firewall → IP Management**. One **Add IP rule** dialog covers both blacklist and whitelist entries.

## Blacklist an IP

1. Go to **Security Ninja → Firewall → IP Management**.
2. Click **Add IP rule**.
3. Enter one IP address or CIDR range per line.
4. Optionally add a **Note** (up to 150 characters). The same note applies to every line in that save.
5. Select **Blacklist**.
6. Click **Save**.

![Add IP rule dialog with Blacklist selected](https://wpsecurityninja.com/media/2026/08/firewall/blacklist-ip-field.png)

Blacklisted IPs are denied according to your firewall settings (full site block when **Prevent banned IPs from accessing the site** is on).

## Whitelist an IP

Use the same dialog and select **Whitelist** before saving. Whitelisted IPs keep access even when the cloud list or a country rule would otherwise block them. Traffic may still appear in logs.

![Add IP rule dialog with Whitelist selected](https://wpsecurityninja.com/media/2026/08/firewall/whitelist-ip-field.png)

If the same IP is both blacklisted and whitelisted, **whitelist wins** so you do not lock yourself out.

## Ranges and wrong IPs

* Block a network: [Ban subnet / IP range](https://wpsecurityninja.com/docs/firewall/ban-subnet-mask/).
* Bans or logs show a Cloudflare edge IP: fix [Visitor IP detection](https://wpsecurityninja.com/docs/firewall/visitor-ip-detection/) on **Firewall → Settings** first.

## Related

* [Visitor IP detection](https://wpsecurityninja.com/docs/firewall/visitor-ip-detection/)
* [How to block a country](https://wpsecurityninja.com/docs/firewall/how-to-block-a-country/)
* [How to access your website via FTP](https://wpsecurityninja.com/docs/installation-and-usage/how-to-access-your-website-via-ftp/)
* [Secret Access URL](https://wpsecurityninja.com/docs/firewall/secret-access-url/)
