The Comment Blacklist (Settings, Discussion) is a core WordPress feature that you can use to block spam. It accepts IP addresses or words, one word, phrase, or IP address per line.
Blocking IP addresses is not very successful in blocking spam these days because spammers don’t always use the same IP address, or use bot nets that make blocking IP addresses a losing game. Still, there are some cases in which the Comment Blacklist can be helpful.
Contact forms coming from an IP address you’ve listed in the Comment Blacklist and those containing a word or phrase you’ve included in the Comment Blacklist will be blocked.
Using IP Addresses
Once you’ve added an IP address to the Comment Blacklist, you must include the IP address in your contact form. Simply include the Special Mail Tag “[_remote_ip]” in the Message Body section of the Mail Tab when you edit a contact form: