IP address character limit

You can filter 'get_comment_author_IP':

add_filter( 'get_comment_author_IP', 'wpse_77254_trim_comment_ip' );

function wpse_77254_trim_comment_ip( $ip )
{
    return implode( '.', array_slice(explode( '.', $ip ), 2) ) . '…';
}

Note this will fail with IPv6 addresses.

Leave a Comment