How to Block IP Addresses in WordPress.
Each computer connected to the internet has an IP address assigned by their internet service provider.
Step 1 – To blocking an IP address from accessing your website with unwanted visitors, spam comments , email spam, hacking attempts, and DDOS (denial of service) attacks.
Step 2 – If you feel this is a spam comment, please login to your cpanel and verify the server log by using below steps
Step 3 – Inside the Raw access you will have the zip file, download the file and extract and open in notepad/ notepad++. The access log file contains raw data of all requests made to your website. Each line begins with the IP address making that request.
Step 4 – Once you have found those IP addresses which is involving the unwanted activities , do filter the addresses. Once done, do paste the IP in wordpress >> Settings >> Discussion and choose the “Comment Blacklist’ and IP in that text box.
Step 5 – Now WordPress will block user with these IP addresses from leaving a comment on your website. These user will be able to visit your website, but they will get an error message when they try to submit a comment.