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' );