• Hi.

    I am trying to anonymize the user IP address that is saved by CF7 and Flamingo.

    From the CF7 DOCUMENTATION it seems enough to use the wpcf7_remote_ip_addr filter associated with the wpcf7_anonymize_ip_addr function by inserting the following code in the functions.php file:

    add_filter ('wpcf7_remote_ip_addr', 'wpcf7_anonymize_ip_addr');

    But this doesn’t work!

    I also made an alternative function:

    if ( function_exists( 'wpcf7_anonymize_ip_addr' ) ) {
        function custom_anonymize_ip_addr($ip_addr) {
    	    $anonymizeIP = 'xxx.xxx.xxx.xxx';
    	    if ( !empty($ip_addr) ) {
    		    $pieces = explode('.', $ip_addr);
    		    $anonymizeIP = $pieces[0] .'.'. $pieces[1] .'.xxx.xxx';
    	    }
    
            return $anonymizeIP;
        }
        add_filter('wpcf7_remote_ip_addr', 'custom_anonymize_ip_addr', 10, 1);
    }

    but it looks like the wpcf7_remote_ip_addr filter doesn’t exist…

    Other solutions to anonymize the user’s IP?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Anonymaze IP Address’ is closed to new replies.