Tired Of People Spamming Your Contact Form? Block Their IP Address!

stop spamming my form

Time and time again I will get the same person trying to market to me through my contact forms on my site.  I work in web design in NJ, so it’s a common occurrence for people in my industry.  Let me tell you, it’s annoying.  You tell them “no, I’m not interested.” and still they resume in the constant bugging & begging.  Instead of constantly having to delete their spam email over & over, how about just block their entire IP address from accessing your WordPress site.  Here’s How:……

Track Their Remote IP In Contact Form 7

The first thing you will need is the plugin “Contact Form 7”.  If you are already using it, great.  If not, I recommend using it for your contact forms, because there is so much you can customize with it.  But right now I’m going to focus on tracking the IP address of people that fill in your forms.   When you are setting up a new form, go to the “mail” tab and add this anywhere in the message body;


That’s it.  This one line will return the IP address of the person that just filled out your form when you get the message in your email box.  Next comes the part where you can block them.

Block Their IP In Wordfence

If you don’t have Wordfence installed, WHICH YOU SHOULD…., install it, and then go to Firewall -> Blocking.  Simply add the IP address into the block field and you’re done.

The next time they try to go to your site to bug you………

your ip has been blocked. NO!

Related Posts

Scroll to Top