Activate the opt-in checkbox for comment cookies in WordPress
In the last few weeks I've been asked more and more why my WordPress themes don't show the checkbox for comment cookies, which was introduced with WordPress 4.9.6. The reason for this is not a bug, but changes in the WordPress core itself. Therefore, I would like to briefly show you how you can activate the opt-in checkbox for comment cookies in WordPress.
For understanding, here is a screenshot of the opt-in checkbox for comment cookies:
What are comment cookies?
In principle, no cookies are required for the comment function of WordPress. The data of a comment such as name, e-mail and content are recorded by the comment form and stored in the WordPress database. The data processing of the comments should therefore also be listed in the data protection declaration.
WordPress has always had a feature for a little more convenience with regular commentators. When sending a comment for the first time, WordPress remembered the name, e-mail and website of the user and automatically filled in these input fields for the next comment so that the information did not have to be entered again.
The form data was saved locally with a cookie in the user's browser. Because the creation of a cookie without explicit consent is problematic with the GDPR, this feature has undergone some changes in the last WordPress core updates:
Up to WordPress 4.9.5
Up to WordPress 4.9.5, the form data of the comments were generally saved in a cookie without asking for the user's consent.
WordPress 4.9.6
With version 4.9.6 a new checkbox was introduced, which obtained the consent of the user to save the form data. You have probably seen the option to save my name, email and website in this browser until I comment again , including here on my blog.
WordPress 4.9.8
Somewhat unnoticed, another change took place in the update to 4.9.8. Now the checkbox for comment cookies is only displayed if it has been activated in the WordPress settings.
Show the opt-in checkbox for comment cookies in WordPress
You can find the new option under Settings → Discussion in the WordPress backend. The feature can now be activated or deactivated with the new setting Show opt-in checkbox for comment cookies .
By default, the setting and the comment cookies are now completely deactivated and the convenience function for saving the form data is not available to any user.
Administrators can activate the feature with the new setting, after which the checkbox is displayed in the comments. Commenters can now have their form data saved with the comment cookie if they wish.
Both options - feature activated or deactivated - are therefore data protection compliant. Either a) cookies are never saved or b) cookies are only saved with the consent of the user.
Please note that the checkbox is generally not displayed for logged in users. You must therefore log out of your own website or call it up in another browser to test it.
Conclusion
The last WordPress core updates were very confusing in this regard. With 4.9.6 the checkbox was automatically displayed, a little later in 4.9.8 it was removed and must first be activated in the options. I hope this post helps clarify something.
Hello Brian,
Thanks for the tip! In WP 4.9.8 I hadn't noticed the new option.
Hello Hans,
With pleasure! I didn't notice the change immediately either, when some users of my themes reported this as a bug.
Many Greetings,
Brian
Hello everyone, I would like to know if there is a similar function in a plugin, which creates the possibility to inform the user about new posts when the checkbox is clicked?
many Greetings
Jens August
Hello, Jens,
I myself use the Subscribe to Double-Opt-In Comments plug-in here in the blog: https://de.wordpress.org/plugins/subscribe-to-double-opt-in-comments/
Many Greetings,
Brian
The only thing is: The comments go through - with or without a checkbox. With regard to the GDPR, it would also make more sense to ensure that the tick was ticked.
Hello Joachim,
It is true that all comments go through. As described in the article, the comment cookies are used to save the name, email and website of the user as a convenience feature for the next comment, but not for the actual comment function.
If, in addition to a note in the data protection declaration, you want to query the user's consent to save the comment with an extra checkbox, you need additional plugins, WordPress Core is not enough. Although in my opinion filling out and submitting a comment implies that it will also be saved.
Many Greetings,
Brian
Hello everybody,
I use a privacy checkbox on my forms, which must be clicked. This means that data processing is accepted by the visitor in accordance with the GDPR.
Source: https://wordpress.stackexchange.com/questions/127027/how-to-add-a-privacy-checkbox-in-comment-template
I built the code into my own data protection plugin "WP H-Data Protection" so that it doesn't always have to be inserted into the respective theme:
https://web266.de/software/eigene-plugins/wp-h-data-protection/kommentare-privacy-checkbox/
At the bottom of the page you can see the checkbox under the comment field.
My plugin "WP H-Data Protection" can be found here
https://web266.de/software/eigene-plugins/wp-h-data-protection/
or via GitHub
https://github.com/m266/wp-h-data-protection
can be downloaded for testing.
My own guestbook is based on the comment function and also contains the checkbox:
https://web266.de/gaestebuch/
LG Hans
Hello Hans,
Thank you for pointing out and introducing your plugin, it looks great 🙂
LG,
Brian