Blocking IP Addresses in WordPress
Head over to Settings » Discussion page and scroll down to ‘Comment Blacklist’ text box. Copy and paste the IP addresses that you want to block and then click on the save changes button. WordPress will now block users with these IP addresses from leaving a comment on your website
Easy steps to block IP address
1. First find the IP address you want to block.
2. Go to the Discussion option given in settings in the sidebar
3. Scroll down to the Comment Blocklist section.
4. Paste the IP address here.
5. Click on DONE, then refresh the page to save changes.