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
- Log in to cPanel.
- Open IP Blocker under the Security section.
- Enter a single IP, a range, or a domain in the box.
- 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.