IP Address blocking is a security measure that prevents a connection between a specific or group of IP addresses and a mail, web or Internetserver. This is usually done to ban or block any undesirable sites and hosts from entering the server or node and causing harm to a network of individual computers. IP blocking is usually used by companies and websites to prevent intrusion, block spam and protect against hacking attacks.
In this article, we will demonstrate how to block IP addresses within WordPress and also how to identify the necessary IP addresses to block.
Identifying The IP Addresses You Want To Block
There might be several instances when you will want to discover a certain IP address in order to block it. If someone is leaving spam comments on your page then you can head over to the "Comments" tab on the left-hand sidebar of WordPress Admin page. You will be able to see full details of including the IP address of any commenters.
If you find that your website is under an attack, for example, a DDOS attack, then the best way to locate the offending IP address is to head to your servers access log. You will need to login to the cPanel dashboard of your WordPress Hosting account and locate the 'Logs' section. Once there, click 'Raw Access Logs'.
You will be redirected to the access logs page where your next step is to click on your Domain Name to download the access log file.
Once you have extracted the file by clicking on it, you will be shown your access log file. The best way to view this is with a plain text editor such as Notepad.
All the raw date of requests being made to your website are logged here, with each line beginning with the IP Address making that request.
We recommend copying any suspicious IP address and using this onlineIP lookup tool before you block any IP addresses, as you wouldn't want to inadvertently block legitimate users. You want to check for IP addresses with an unusually high number of requests.
Once you have located any offending IP addresses, copy and paste them into a separate Notepad file.
Block IP Addresses In WordPress
If all you want to do is stop a specific IP address from leaving comments on your WordPress site, just head to the 'Settings > Discussion' page and scroll to the "Comment Blacklist" box. Paste any IP addresses you want to be blocked in this box and they will no longer be able to leave comments on your website.
Blocking An IP Address With cPanel
This method completely blocks an IP address from accessing or viewing your website. You should use this method when you want to protect your WordPress site from hacking attempts and DDOS attacks.
First, you need to login to cPanel dashboard of your hosting account. Now scroll down to the security section and click on the ‘IP Address Deny Manager’ icon. This will take you to the IP Address Deny Manager tool. Here you can add the IP addresses you want to block. You can add a single IP address or an IP range and then click on the add button.
Come back here to unblock any IP addresses.
Using Wordpress? Get our lightening fast Wordpress Optimised Hosting from £1.60 / month
Do you need to increase the memory limit in WordPress? Getting an error about memory Exhausted? The memory limit is one of the most common WordPress errors as the default limit of memory in WordPress is only set to 64mb! But there’s good news! The Memory Exhausted error is one...
A vulnerability has been discovered in the “All In One WordPress Migration” WordPress plugin. All versions earlier than, and including 6.97 contain a vulnerability which allows Cross-Site Scripting (XSS).With over 2 million active installations, this vulnerability has the potential to be high impact, however, this is lessened by the nature...
HostPresto will be launching a European point of presence in the coming weeks, specifically in Amsterdam. For customers needing their data located within the EU still please contact support to request migration to this location with ticket subject ‘EU Migration’. We will ensure this is actioned well before the Brexit...