Sometimes, you may need to block traffic to your website. This can be done in your cPanel by blocking the IP address.  You can block just one IP, or a range of IPs from accessing your site.

Why would I block an IP Address?

Most website owners never have to worry about blocking an IP address.  However, there are a few instances where you may need to:

  • An IP address is trying to hack your site. If in your logs you see one IP trying to access your files via FTP, you can block it. This will prevent whoever was using that IP from attempting to hack your site.
  • An IP address is visiting your website suspiciously. In rare situations, you may see an IP from a different country visiting your site. This is pretty normal, but if the IP's connecting hundreds of times a day, it may be suspicious. You may choose in that situation to block the IP address.
  • You don't want someone accessing your site. This can be for a variety of reasons. But if there's one person you don't want visiting your site, you can add their IP to the block list.

How do I Block an IP Address?

First, log into your cPanel. Navigate to the IP Deny Manager:

denymanager1

This is where you will enter the IP address. Put the full IP address in the blank field and click Add:

denymanager2

The next screen will confirm the IP address has been added:

denymanager3

It is that simple! You can also add a range of IPs.  If you enter in a range of IPs:

denymanager4

Then on the "Current IP addresses being blocked" section it will list every IP not allowed:

denymanager5

You can remove an IP from the list by clicking the red X in the "Remove" column.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Comments

n/a Points
2015-08-05 9:29 am

Hi, I am running a PrestaShop store, but basically I am a writer so lacks some technical knowledge. I am not seeing this option on FTP, I am thinking about using .htaccess file. Firstly I was looking to use a this block IP module bit.ly/1MqAMRW . Method of blocking is really simple through module but if it can be done with .htaccess, I will like to try. Please let me know that from where I can find this .htaccess file, it will be in FTP or theme files?

Staff
17,314 Points
2015-08-06 2:58 am
Hello Lusi,

The .htaccess file can be found by using the File Manager, in cPanel. It's a HIDDEN file. You would need to set the File manager to see the files. It is typically located directly under the folder where your website files are stored. The default root directory for your website is the public_html. The .htaccess file is a text file that can be easily edited. The option available in cPanel (IP Deny Manager) lets you block IP addresses without having to edit the file. The .htaccess file can be found using FTP, but it's not located in the folder labeled "public_ftp". FTP is simply a tool that can list all of the files within your hosting account. cPanel File Manager does that as well. I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.
n/a Points
2018-01-17 3:12 am

Is it possible to bypass the HTAccess file and gain access to the website anyway despite an IP Deny? I have an IP range blocked, but the person I'm trying to block got through anyway according to Stat Counter data which reacts to clicks on the page using a javascript code I got from Stat Counter. Is the only way to by pass it hacking? My server provider is ignoring the Stat Counter proof insisting that the intruder isn't getting through.

Staff
17,314 Points
2018-01-17 5:44 pm
If they're using an IP address that is not blocked then they will be able to gain access to the website. Log files will confirm IP addresses are accessing your site. You will need to check those to verify if the security scripts are working or not.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 757-416-6627 Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}