Add this to the functions.php file
function wp_use_cf_client_ip($comment_author_ip) {
if(isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {
return $_SERVER['HTTP_CF_CONNECTING_IP'];
}
// return defalt otherwise
return $comment_author_ip;
}
add_filter('pre_comment_user_ip', 'wp_use_cf_client_ip');

0 Comments