Support » Fixing WordPress » Update 4.9.6: Checkbox comments – Privacy approved?

  • Hi there,

    update 4.9.6 shows a new comments check box for not logged in users.

    a) Theoretically: Is there any way to disable the checkbox and/or the function of saving name and emailaddress in a cookie?
    b) Theoretically: Is there any way to change the text?
    c) Is there any way to configure, that the box isn’t checked by default? I think that is not privacy approved the way it’s implemented.


    • This topic was modified 4 years, 8 months ago by David181.
Viewing 7 replies - 1 through 7 (of 7 total)
  • As can be seen here, that field goes through the comment_form_default_fields filter.

    These are untested codes, but placing them into your functions.php should do what you want:

    Disable the checkbox

    function comment_form_hide_cookies_consent( $fields ) {
    	unset( $fields['cookies'] );
    	return $fields;
    add_filter( 'comment_form_default_fields', 'comment_form_hide_cookies_consent' );

    Change the text

    function comment_form_change_cookies_consent( $fields ) {
    	$commenter = wp_get_current_commenter();
    	$consent   = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
    	$fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
    					 '<label for="wp-comment-cookies-consent">Your modified text here</label></p>';
    	return $fields;
    add_filter( 'comment_form_default_fields', 'comment_form_change_cookies_consent' );

    Don’t check by default

    function comment_form_not_checked_cookies_consent( $fields ) {
    	$fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" />' .
    					 '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>';
    	return $fields;
    add_filter( 'comment_form_default_fields', 'comment_form_not_checked_cookies_consent' );

    I have a problem I can’t see the chexbox under comment box how I can add it please I have 2 blogs both oh them doesn’t showing
    Thank you for your help

    Hi! It would be better to create another topic (your problem is of course related, but doesn’t have the same solution). In the meantime check if you really are using the WP 4.9.6 version.

    Thread Starter David181


    Thanks, Felipe, for your help!

    You’re welcome!

    If your question has been answered, we would love if you would mark this topic as resolved in the left hand sidebar. This helps our volunteers find the topics that still need attention and more people will get helped, possibly like you did.

    Ho lo stesso problema di papillon14rose , ho cercato per vedere se c’è un altro topic ma non vedo nulla.
    Ho provato a aprirne uno io ma non riesco.

    Google Translation:

    I have the same problem as papillon14rose, I tried to see if there is another topic but I do not see anything.
    I tried to open one myself but I can not.

    You can visit this link and use the form located at the bottom of the screen. You can also use the Italian WordPress Forums.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Update 4.9.6: Checkbox comments – Privacy approved?’ is closed to new replies.