How do I turn off wordpress comments ability to capture a users ip address?

Add this to your functions.php:

add_filter('pre_comment_user_ip', 'no_ips');
function no_ips($comment_author_ip){
  return '';
}

You’ll still have the comment_author_IP field in the db, but it will be empty…

And to remove existing IP records from the db run this query:

UPDATE `wp_comments` SET `comment_author_IP` = ''

Leave a Comment