How to Block an IP Address in cPanel

Stop unwanted visitors or attackers by blocking specific IP addresses or ranges using the cPanel IP Blocker tool.

· Updated · 2,153 views

If a particular IP address is spamming your forms, scraping your content, or attempting to break in, you can block it at the server level so it never reaches your site. cPanel provides a simple IP Blocker for this.

Block an IP in cPanel

  1. Log in to cPanel.
  2. Open IP Blocker under the Security section.
  3. Enter a single IP, a range, or a domain in the box.
  4. Click Add.

The address is added to your deny list immediately and the block takes effect right away.

Accepted Formats

| Format | Example | | --- | --- | | Single IP | 203.0.113.5 | | Range | 203.0.113.1-203.0.113.255 | | CIDR | 203.0.113.0/24 | | Implied range | 203.0.113.* |

Block via .htaccess

You can also deny addresses in the .htaccess file inside public_html:

<RequireAll>
    Require all granted
    Require not ip 203.0.113.5
</RequireAll>

This is useful when you want the rule to live with your site files.

Find the Offending IP

  • Check Raw Access logs or the Errors tool in cPanel.
  • Look for repeated requests from the same address.
  • Confirm the IP is not your own before blocking it.

Avoid blocking large ranges unless you are certain, as you may accidentally lock out legitimate visitors, including mobile users who share carrier IPs. Remove a block at any time from the Currently-blocked IP addresses list in the same tool.

Was this article helpful?

Your feedback helps us improve our documentation.

Still Need Help?

Our support team is available 24/7 to assist you.