How to Block an IP Address in cPanel


The IP Blocker tool in cPanel allows you to block specific IP addresses or IP ranges from accessing your website. This is useful for blocking malicious bots, spammers, attackers, or unwanted visitors.

Steps to Block an IP Address

  1. Login to cPanel.
  2. Under the Security section, click IP Blocker.
  3. In the Add an IP or Range field, enter the IP address or range you want to block. Examples:
    • Single IP: 192.168.1.100
    • IP Range: 192.168.1.0/24
    • Wildcard Range: 192.168.1.*
    • Range with dash: 192.168.1.1-192.168.1.255
  4. Click Add.

The blocked IP will receive a 403 Forbidden error when trying to access your website.

Blocking via .htaccess

You can also block IPs manually using your .htaccess file:

# Block a single IP
Deny from 192.168.1.100

# Block an IP range
Deny from 192.168.1.0/24

# Allow all except blocked IPs
Order Allow,Deny
Allow from all
Deny from 192.168.1.100

Finding the IP Address to Block

To find the IP of a malicious visitor, check your cPanel → Metrics → Raw Access Logs or Visitors logs. Look for repeated requests from the same IP in a short timeframe.

Note: Be careful not to block your own IP address. To find your current IP, visit whatismyipdetails.com before adding any blocks.

Removing a Blocked IP

To unblock an IP, go to cPanel → IP Blocker, find the IP in the Currently Blocked IPs list, and click Delete.

If you continue to face issues, please open a create a request.

Was this answer helpful? 0 Users Found This Useful (0 Votes)