How to Show Site Visitor’s IP Address on WP Forms Output

by | Mar 27, 2021 | Technical Help, WordPress

The WP Forms plugin for WordPress is fairly popular and one of the plugins I like using for handle form inputs on websites. I especially like being able to tie in Google RECAPTCHA into it which greatly reduces form spam.

Form spamming has become big business. Apps (pieces of software that scan the web looking for forms to fill in) are built on a regular basis to fill in forms with spam. Most website owners have little or no understanding of how and why they seem to get inundated by spam messages from their website forms. Often they think something has been hacked or they are subject to otherwise malicious intent. The fact is, their form was merely discovered and is being filled out by software rather than human beings.

Showing the site visitor’s IP address can help determine whether the output received from forms is “real” or not. It isn’t an absolute determination though. The site visitor may be using a virtual private network (VPN) which can hide their true IP address and only show the IP address of their VPN provider. But, in most cases, it will show an address from where the general location form output originated from.

Adding the IP address to WP Form output

One great thing about determining the IP address of a spammer, is that their IP address can then actually be blocked. They can be blocked from viewing or accessing entire servers. So, from the aspect of someone running their own hosting services as we do, that is a great piece of information to know.

What didn’t work for me

Adding templates to the theme did not work as explained within the WP Forms template files. I tried to do this in my child theme.

Inside each of the PHP file texts of the WP Forms templates are indications that one can insert a new copy of the template file within the theme structure. This is along the lines of how child themes actually work – they look for a file in the child theme first and use it before looking in the parent theme. I added the templates exactly as indicated within the templates themselves inside the structure of a site’s child theme to no avail.

It is important to make hard coding changes to a child theme and not the parent theme (hence the importance of using a child theme in the first place). Making coding changes to the original parent theme subjects your changes to loss upon theme updates to that original theme. Since I tried adding the templates to the child theme and it didn’t work, I quickly abandoned this method. I am never willing to add any hard coded files to the parent theme, so I sought another way to accomplish the task.

What did work for me

Adding code to the child theme’s functions file ultimately worked. While this method took much longer to discover a solution, it worked with an amazingly small amount of coding and only took a few minutes to implement (after many hours of trying all that didn’t work).

I searched for information about the WP Forms templates and ultimately discovered some developer geared help on their website. From that, I was able to glean a working copy of a function to add to my site that accomplished the job in a minimal amount of code.

So here is the finished code that I simply added to the end of my child theme’s functions.php file:

/* -- Start of CharlesWorks WP Forms ip address shortcode --*/
function wpf_ip_footer_text( $footer ) {
$footer = $footer . ' from IP address ' . $_SERVER['REMOTE_ADDR'];
return $footer;
}
add_filter( 'wpforms_email_footer_text', 'wpf_ip_footer_text' );

/* -- More info at https://wpforms.com/developers/how-to-remove-or-change-email-notification-footer-text/ --*/
/* -- End of CharlesWorks WP Forms ip address shortcode --*/

As you can see, this is a very simple piece of code that merely adds some text and the IP address of the site visitor on the tail end of the existing WP Forms footer message. But it does the job.

CLICK HERE to find your domain name!   CLICK HERE to transfer your domain name!

Archives

Tags

24 hour (1) Accessibility (2) Accounting (1) Advertising (16) AdWare (1) Alex Johnson (2) Alignment (1) Android (2) Anti-Virus (1) Antivirus (1) Antrim Computer Repair and Service (3) APC Back-UPS (1) Appearance (2) Apple Mail (4) Apple Mobile Mail (2) Attachments (1) Audit (1) Authorized (1) Autoresponder (5) Availability (1) Backups (1) Badges (3) Bank Account (1) Bank Statement (1) Battery Backup (2) Better Business Bureau (3) Bob Hill (1) Bookkeeper (1) Branding (8) Budget (2) Business (29) Business Management (1) Catalog (1) Categories (1) Charles Oropallo (1) CharlesWorks (42) Cherryl Jensen (1) Chrome (1) CleanTalk (1) Cloud (1) Code (2) Communicating (1) Competition (1) Computer (2) Computer Cache (1) Computer Hardware (1) Computer Security (2) Constant Contact (1) Consultation (1) Contact Information (2) Content (1) Content Management (38) Content Management System (1) Copiers (1) Copy Machine (1) Coronavirus (2) Courteous (1) COVID-19 (3) Credibility (9) Credit Card (1) Credit Card Processing (1) CSS (9) Customer Service (2) Database (1) Debian (1) Design (48) Design Expertise (1) Desktop (1) Dialup (1) DirectAdmin (4) Directions (1) DIVI (7) DNS (2) Do-it-Yourself (1) Documentation (1) Domains (18) Domain Transfers (5) E-Commerce (1) ecommerce (1) Elementor (1) Email (65) Email Lists (4) Email Management (4) Email marketing (4) Etiquette (3) Eudora 6 (1) Exchange (1) Expanding (1) Facebook (2) Financial (1) Finish (1) Firefox (1) Fonts (1) Forms (2) Forms Protection (1) Fraud (2) Galaxy S4 (1) General Info (1) Gmail (1) GoDaddy (1) Google (1) Google Adwords Certified Partner (1) Google Chrome (2) Groups (1) Happy Holidays (1) Hardware Help (1) Hill Specialty Networks (1) Hosting (1) Images (1) IMAP (1) include (1) Infected (1) Information (36) insert pages (1) Internet Browsing Errors (1) Internet Consultant (1) Internet Explorer (1) Joomla! (1) Keywords (2) Laptop (1) Legibility (1) Linux (12) Logging on (1) Macintosh (1) Mail 6.0 (1) Mail 2011 (2) Make-Over (1) Malicious (1) Malware (1) Marketing (8) Matt Burke (3) MDaemon (3) MelbourneIT (2) menu (1) Merchant (1) meta (1) Microsoft (1) Microsoft Edge (1) Microsoft Hosted Exchange (5) Microsoft Live (2) Mobile Email Setup (1) Monadnock Region (1) Mozilla Firefox (2) MySQL (1) Nathan Wesley (1) Netscape (1) Netscape Messenger (1) Office Copiers (1) OfficeLive (1) Online (1) Outlook (9) Outlook 2010 (2) Outlook Express (1) PayPal (1) Pay Per Click (2) PC (1) Personal (1) Peter Harris (1) Peter Harris Creative (1) Phishing (2) PHP (3) pixel (1) plugins (1) Pop Email (1) Popularity (1) Portfolio (1) Power Grid Failure (1) PPC (1) Prevent Fraud (1) Privacy (1) Private (1) Product (6) products (1) Professional (6) Projects (2) Protect (1) Protection (1) QR codes (1) Quality (2) QuickBooks (1) Reconciliation (1) Reduce Risk (1) Register (1) Reliability (2) Renew (1) Reseller (2) Resolution (1) Restrict User Access (1) Results (1) Review (2) Risk (1) Robin Snow (1) Roundcube (1) Safe (1) Samsung (2) Scam (18) Scammer (18) Search (1) Search and Replace (1) Search Engine Optimization (SEO) (21) Security (28) Security Risk (1) Selling (1) Servers (2) Service (11) Shopping Cart (1) Site (1) SmarterMail (9) Social Engineering (1) Social Networking (1) Software (1) solar flares (1) Solutions for Today (1) Spam (1) Spam Filtering (16) Spammer (1) Spyware (2) SquirrelMail (1) SSL (8) Statistics (2) Stats (2) Stone Pond Technology (1) Storage (1) Support (1) Tablet (1) Target Market (1) Technical Help (1) Testimonials (9) The CW Corner (1) Thom Little (1) Thom Little Associates (1) Thunderbird (3) Thunderbird 10 (2) TLD (1) Topic (1) Top Level Domains (3) Transaction (2) Transfer Data (1) Transfer Funds (1) Typography (1) Update (2) Uploading (1) UPS System (2) Up to Date (1) Virtualmin (1) Virus (2) Viruses (1) Vista (1) Web (1) Web-Over (1) Web Development (101) Web Hoster (1) Web Hosting (2) Web Hosting Company (1) Webmail (8) Web Mail (1) Webmaster (10) Webmin (1) Web Presence (28) Website (113) Website Development (1) websites (2) Web Stats (1) Web terms (1) Web Writing (1) Windows 7 (2) Windows Mail (6) Windows XP (1) WooCommerce (6) WordPress (90) WordPress Updates (1) Working Remote (2) Writing (1) YouTube (1)
Protected by CleanTalk Anti-Spam