To block the IP address of a specific network ID on a WordPress website first starts with a basic knowledge of IP addresses to get a clear idea.
An IP address has two parts;
Network ID: first three numbers of the IP address
Host ID: fourth number in the address.
Example of a Network ID and Host ID:
IP address: 85.119.11.107
Network ID:85.119.11
Host ID: 107
Method 1: By .htaccess file
You can add the following code to your .htaccess file:
<Limit GET POST>
order allow, deny
deny from 185.119.11
allow from all
</Limit>
This will block all IP addresses that start with 185.119.11 from accessing your website.
Method 2: By WordPress plugin
To block an IP address that starts with a specific network ID on WordPress, you can use a plugin following plugins;
- “Ban IP.”
- “Block IP”
Both of these plugins allow you to easily block specific IP addresses from accessing your website.
Note: if you make a mistake in the .htaccess file, the website could go down, I will recommend you to always keep a backup of your .htaccess file before any modification in .htaccess.