Contact Form 7 5.0.3

Contact Form 7 5.0.3 is available. This is a maintenance release including some bug-fixes and improvements. In addition, Contact Form 7 5.0.3 introduces a few features related to personal data protection.

Anonymizing IP address

Contact Form 7 5.0.3 added the wpcf7_anonymize_ip_addr function. This function anonymizes an IP address by replacing the last octet (IPv4) or the last 80 bits (IPv6) of the address with zero values.

$anonymized = wpcf7_anonymize_ip_addr( '198.51.100.123' );
// $anonymized => '198.51.100.0'

If you want to anonymize form submitters’ remote IP addresses to ensure that you don’t collect their personal data (user’s IP address is a type of personal data in terms of the current personal data protection standards like GDPR), use this function in combination with the wpcf7_remote_ip_addr filter hook, like this:

add_filter( 'wpcf7_remote_ip_addr', 'wpcf7_anonymize_ip_addr' );

If you want to decide whether to store the submission data in the database based on the submitter’s selection, you can do it with the newly introduced consent_for:storage form-tag option. While it is possible to use this option in any type of form-tags that accept user input, using it in an acceptance checkbox form-tag, like the following example, is the most common use:

[acceptance your-consent consent_for:storage optional] I consent that this submission data is to be stored in the database. [/acceptance]

If the submitter doesn’t select the checkbox, Contact Form 7 sets the do_not_store property and allows message storage plugins like Flamingo to not store this submission, so the entirety of the submission data won’t be stored in the database.

Requires: WordPress 4.8 or higher
Tested up to: WordPress 4.9.7

» Download Contact Form 7 plugin from WordPress.org

Change log

  • CSS: Applies the “not-allowed” cursor style to submit buttons in the “disabled” state.
  • Acceptance Checkbox: Revises the tag-generator UI to encourage the use of better options in terms of personal data protection.
  • Introduces wpcf7_anonymize_ip_addr() function.
  • Introduces the consent_for:storage option for all types of form-tags.