How Do I Block Suspicious IP Addresses? Print

  • Block IP, IP Ban, Deny IP, Prevent Access
  • 0

If you notice a specific IP address repeatedly trying to hack your site, spamming, or scraping content, you can block them at the server level.

Method 1: Using cPanel's IP Blocker (Easiest)

  1. Log in to your cPanel.

  2. In the "Security" section, click on "IP Blocker."

  3. In the "IP Address or Domain" field, enter the IP address you want to block.

    • You can block a single IP: 192.168.1.1

    • Or a range: 192.168.1. (this blocks 192.168.1.0 to 192.168.1.255)

  4. Click "Add."

Anyone trying to access your site from that IP will now see a "Forbidden" error.

Method 2: Using .htaccess (Manual)
For advanced users who want more control:

  1. Go to File Manager > public_html and edit the .htaccess file.

  2. Add the following lines:

    apache
    <RequireAll>
        Require all granted
        Require not ip 192.168.1.1
        Require not ip 192.168.1.
    </RequireAll>

Method 3: Using a Firewall Plugin (WordPress)
Plugins like Wordfence have a "Live Traffic" feature where you can see all visits and instantly block suspicious IPs with one click.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution