• Resolved thomastolkien

    (@thomastolkien)


    I’m trying to prevent Jetpack’s contact form from including a user’s IP address being sent in the contact from response email to a website administrator.

    So far I’ve tried this:

    But it’s not worked. Please can you advise? Thanks.

    //remove user IP address from contact form emails
    function filter_feedback_ip_field_value( $value, $field_id ) {
        if ( $field_id === '_feedback_ip' ) {
            // Return an empty value to remove the IP address from the email
            $value = '';
        }
        return $value;
    }
    add_filter( 'jetpack_grunion_contact_form_field_value', 'filter_feedback_ip_field_value', 10, 2 );
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Paulina H. (a11n)

    (@pehaa)

    Hey there,

    This should be possible with the jetpack_forms_response_email_footer filter – see here.
    The parameter is an array containing the footer output line by line.

    My quick test allowed me to remove the IP Address line with the following:

    add_filter( 'jetpack_forms_response_email_footer', 'my_jetpack_forms_response_email_footer', 10, 1 );
    	
    function my_jetpack_forms_response_email_footer($array) {
    	unset($array[4]);
    	return $array;
    }

    That said, I would recommend looping the array and detecting the IP Address line for a more sustainable solution.

    I hope that the above helps! Would you mind sharing why you want to remove this information?

    Thanks!

    Thread Starter thomastolkien

    (@thomastolkien)

    Thank for the info!

    In reply to your query:

    Including the IP address and storing it on the website owner’s hosting server breaks GDPR law since there’s no way for the website user to opt out of the data collection prior to pressing send (and the user’s IP address data is not essential to the running on the website owner’s site). Also, the privacy disclaimers for Jetpack relate only to IP addresses being stored by Jetpack, Askimet and WordPress.com servers, not the website owner’s hosting server, which is misleading given the actual process. Including the IP address in the email reply is effectively presenting evidence of a GDPR data protection breach and presents a liability issue to the website owner. So that’s why there must be either an opt out for the user, or an opt out for the website owner; or preferably both.

    Thread Starter thomastolkien

    (@thomastolkien)

    Also, we tried your approach of looping the array. However, using this code in functions.php caused a significant performance hit on every page. Do you have a better solution that targets just the plugin and not the whole site? Thanks.

    We aren’t able to provide custom code, as it goes beyond our scope of support. The code snippet we provided should give you a head start for writing your own custom code to change the original Jetpack functionality. You can also find our developer reference here.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Prevent contact form user’s IP from being sent in email’ is closed to new replies.