This guide shows you how to block an IP address in cPanel using the built-in IP Blocker tool. It covers single addresses, ranges, and domain names, then shows you how to confirm the block, remove it, and test it. Most people finish in about 10 minutes.
The steps follow cPanel’s Jupiter theme on InMotion Hosting shared hosting, which we cover in our InMotion Hosting review. You’ll also learn how to spot which IPs deserve a block, how to do the same thing with .htaccess, and when IP blocking simply isn’t enough.
What You Need Before You Start
- A hosting account with cPanel access. This guide uses cPanel’s Jupiter theme.
- The IP address, range, or domain you want to block.
- Your own public IP address, so you don’t block yourself. Search for “what is my IP” from the device and network you use to manage your site, and write the result down.
- A downloaded copy of your current
.htaccessfile. IP Blocker writes its rules into this file, so a backup makes any mistake easy to undo.
The steps are based on cPanel’s official IP Blocker documentation (last updated July 2026) and InMotion Hosting’s support material. Newer cPanel versions that use the Meridian interface place similar controls in a Security area with slightly different labels.
Using Cloudflare or another proxy?
If your site runs behind Cloudflare or another proxy or CDN, your server may see the proxy’s IP addresses instead of the real visitor’s. In that case, a block in cPanel may not catch the visitor, so block them at the proxy instead.
Cloudflare, for example, offers IP access rules and custom firewall rules in its dashboard. Menu names change often, so check your proxy provider’s current documentation for where to set them.
Step 1: Find the IP Addresses You Want to Block
Block based on evidence, not guesses. cPanel keeps several logs that show who is hitting your site and what they’re requesting. In Jupiter these usually sit in a Metrics section, though labels and layout can vary by host and cPanel version.
- Log in to cPanel and look for the Metrics section.
- Open Visitors to see recent requests for a domain, including the visitor’s IP address and the page they requested.
- Open Raw Access to download your full access logs if you need more history than Visitors shows.
- Open Errors to see recent error log entries. Repeated errors from one address can point to probing.
- If you run WordPress with a security plugin, check its traffic or login-attempt log as well.
Look for patterns: hundreds of requests a minute from one address, repeated hits on wp-login.php or xmlrpc.php, or requests for files that don’t exist on your site. Be careful with a single suspicious hit, because one IP can be shared by many people on an office network or mobile carrier.
Step 2: Open IP Blocker in cPanel
Log in to your InMotion Hosting account and open cPanel from your hosting dashboard. In Jupiter, IP Blocker lives on the Tools page.
- Log in to cPanel.
- On the Tools page, scroll to the Security section.
- Click IP Blocker.
Back up and check your own IP first
Before you add a block, save a copy of your .htaccess file and confirm that the address or range you are about to enter does not include your own IP. One wrong range can lock you or real customers out of the site.
Step 3: Block an IP Address in cPanel
IP Blocker has a single input field. You can enter one address, a range, or a domain name, and cPanel converts it into a rule in your account’s .htaccess file.
- In the IP Address or Domain field, enter the address, range, or domain you want to block.
- Click Add.
- Wait for the success confirmation, then return to the IP Blocker page.
Formats IP Blocker Accepts
According to cPanel’s documentation, IP Blocker accepts the formats below. The examples use address ranges reserved for documentation, so swap in the real addresses from your logs.
| Format | Example | What it blocks |
|---|---|---|
| Single IP | 203.0.113.15 | One address |
| Full range | 203.0.113.1-203.0.113.50 | Every address from the first to the last |
| Implied range | 203.0.113.1-50 | The same range, written in shorter form |
| CIDR | 203.0.113.0/24 | 256 addresses, from 203.0.113.0 to 203.0.113.255 |
| Implied IP | 203. | Every address starting with 203, over 16 million in total |
| Domain name | example.com | The IP the domain points to when you add it |
Invalid formats return an error, and valid entries are saved immediately. Treat the implied IP format with care: a single entry like 203. blocks a huge slice of the internet and will almost certainly catch real visitors.
A Note on Blocking by Domain Name
When you enter a domain, cPanel looks up its IP at that moment and stores the address, not the hostname. If the domain later moves to a new IP, your block stays on the old one. If that IP belongs to a shared server or a CDN, the block may also catch more traffic than you intended.
Step 4: Confirm the Block in the Blocked List
After you add an entry, it appears in a table headed Currently-Blocked IP Addresses on the IP Blocker page. The table typically shows these columns:
- Server Setting: the entry as cPanel stored it, in CIDR form.
- Beginning IP: the first address the block covers.
- Ending IP: the last address the block covers.
- Actions: where you remove the entry.
- Scroll to Currently-Blocked IP Addresses.
- Find the row for the entry you just added. Domain entries appear as the resolved IP address, not the domain name.
- Check that Beginning IP and Ending IP cover exactly the addresses you meant to block.
That last check is the fastest way to catch a typo in a range before it blocks someone it shouldn’t.
Step 5: Unblock an IP Address in cPanel
Blocks don’t expire on their own, so remove any you no longer need. Old entries can end up blocking an address that has since been reassigned to a real customer.
- In the Currently-Blocked IP Addresses table, find the row you want to remove.
- Click Delete in the Actions column.
- On the confirmation screen, click Remove IP.
How to Check It Worked
Based on InMotion Hosting’s support material, a blocked visitor gets a standard Apache 403 Forbidden response. In the default setup it’s a plain server error page, not a branded one. To see it yourself, you need to visit from an IP you’ve blocked.
- On a second device, connect to a different network, such as a mobile hotspot or a VPN.
- Look up that device’s public IP address.
- Add that IP in IP Blocker as a temporary test block.
- On the second device, open your site in a private browsing window. You should see 403 Forbidden.
- Load the site from your main connection to confirm it still works normally for you.
- Delete the test block when you’re done.
The block only covers web traffic to your site. Because the rules live in .htaccess, they don’t affect cPanel, webmail, or other services on your account.
How to Block an IP Address in cPanel With .htaccess Instead
IP Blocker writes .htaccess rules for you, so most people never need to edit the file by hand. Doing it manually makes sense when you want to manage a long list in one place or keep notes next to each rule.
Back up .htaccess before editing
A single typo in .htaccess can take your whole site offline. Download a copy of the current file before you change anything, so you can restore it in seconds if something breaks.
- In cPanel, open File Manager and go to your site’s document root, often
public_html. - Turn on the option to show hidden files in File Manager’s settings, because
.htaccessstarts with a dot. - Download a copy of
.htaccessas your backup. - Open the file for editing and add the rule block near the top, outside any
# BEGIN WordPressand# END WordPressmarkers. WordPress can overwrite anything between those lines. - Save the file, then reload your site from your own connection to make sure it still loads.
On Apache 2.4, use the Require syntax:
# Manual IP blocks (Apache 2.4) <RequireAll> Require all granted Require not ip 203.0.113.15 Require not ip 198.51.100.0/24 </RequireAll>This allows everyone except the listed addresses and ranges. Don’t mix the older Order, Allow, and Deny lines with Require lines in the same block, because Apache’s documentation warns that combining them can behave unpredictably.
When IP Blocking Isn’t Enough
IP blocks are precise but easy to dodge. Attackers rotate through botnets, VPNs, and proxy networks, so blocking one address often just moves the traffic to the next. For anything beyond a single persistent nuisance, add stronger layers:
- Rate limiting: caps how many requests one address can make in a set time, so new IPs get throttled automatically. It’s available at many CDNs and in some security plugins.
- Security plugins: WordPress plugins can limit login attempts, block known bad bots, and add two-factor login.
- A web application firewall: a service such as Sucuri filters traffic before it reaches your server. Note that Sucuri is owned by GoDaddy.
- A server firewall: on a VPS you may be able to run a firewall such as CSF. Check which firewall tools your provider currently supports.
If you’re outgrowing shared hosting and want root-level control over a server firewall, compare the best VPS hosting providers.
Some control panels bundle extra protection. ScalaHosting says its SPanel includes its own security tools, so check our ScalaHosting review and the current feature list before you buy.
Running WordPress and want security to be a priority for your host? Our HostArmada review covers how it handles protection.

ScalaHosting
The best all-around web host for performance, security, and support, independently owned and built around its own SPanel technology.
- SPanel control panel
- SShield security
- Managed cloud VPS
- Flexible scaling
- Independent ownership
* Introductory price. Renewal rates apply. Anytime money-back guarantee.
Check out my ScalaHosting Review and grab the latest discount on my #1 web hosting pick for 2026.
Troubleshooting
I Blocked My Own IP and Can’t Reach My Site
Your entry or range includes your own address. Because IP Blocker only affects web traffic, you can usually still log in to cPanel. Open IP Blocker, delete the row, and confirm the site loads again.
If you can’t reach cPanel from your current network for any reason, switch to mobile data or another connection, or ask your host’s support team to remove the rule.
The Block Isn’t Working
The most common cause is a proxy or CDN. If your site sits behind one, your server sees the proxy’s IP rather than the visitor’s, so block the visitor at the proxy instead.
Caching is the second suspect. A CDN or browser can serve a stored copy of a page without the request ever reaching your server. Test from the blocked network in a private window, and purge your CDN cache if you use one.
Finally, check your logs for the exact address. A visitor connecting over IPv6 won’t match a block on their IPv4 address.
Legitimate Visitors Are Getting 403 Errors
Your range is probably too wide, or you used the implied IP format. Shared addresses from mobile carriers and offices can also put real people behind a blocked IP. Compare the Beginning IP and Ending IP columns, delete the wide entry, and replace it with a narrower range.
My Site Shows a 500 Error After Editing .htaccess
A 500 error right after an edit almost always means a syntax mistake or conflicting directives. Restore your backup copy of .htaccess in File Manager and the site should come back immediately.
If you didn’t save a backup, remove the lines you added. Then check Errors in cPanel to see which line Apache rejected.
FAQ
Can I block a whole country in cPanel?
Not practically with IP Blocker alone. You would need to enter every range assigned to that country, and those lists change constantly. Country blocking is far easier at a CDN, through a web application firewall, or with a security plugin that supports it.
Does blocking an IP address stop bots?
It stops that one address, not bots in general. Most bots rotate through many IPs, so rate limiting, a security plugin, or a web application firewall does a better job against automated traffic.
How do I unblock an IP address in cPanel?
Open IP Blocker, find the entry in the Currently-Blocked IP Addresses table, click Delete in the Actions column, then click Remove IP on the confirmation screen.
Is cPanel’s IP Blocker the same as a firewall?
No. IP Blocker writes deny rules into your site’s .htaccess file, so it only controls web requests to that site. A server firewall works across services at the network level, and a web application firewall inspects the content of requests, not just where they come from.
Next Steps
Review your blocked list every few months and remove entries you no longer need. If your current host leaves you fighting bad traffic on your own, compare the best WordPress hosting providers for options with stronger protection built in.
















