User IP Address in Contact Form 7 - WordPress

Recently we installed  Contact Form 7 plugin on a WordPress website. The Client's requirement was to Log IP address with contact form to prevent spam and to record IP of incoming traffic. Contact form plugin provide a number of special mail tags like host, post and specially Remote IP Address in Contact form 7.  Learn how to get user IP address in contact form 7 without any PHP code.

IP Address in Contact Form 7:

  • Open your desired contact form 7 you want to get IP Address.
  • Copy the Below Code and paste in the message body of your Form.
  • [wpcf7.remote_ip]
Remote_IP is a shortcode declared by contact form itself which then return you the remote IP address of the user  who is sending an email. Log the IP address or fight spam to block someone by cPanel.


Control Spam with IP Address:

Get the Remote IP contact form 7 and then you can block them via cPanel to fight spamming via. Most of the spammers send you the fake email by attaching robots to your email form.
Reach those spammer by getting their Internet Protocol(IP) and block them. Learn how to block spammers by IP addresses via cPanel.

Block IP in cPanel:

  • Open your cPanel (e.g.
  • Scroll down and click IP-Blocker.

    cpanel ip blocking
    Blocking IP Address cPanel

  • Now enter the IP Address (e.g. your IP address from email) and click Add.

Post a Comment