diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php
index 5803b1dca0..e68f0b02d3 100644
--- a/src/wp-admin/includes/class-wp-comments-list-table.php
+++ b/src/wp-admin/includes/class-wp-comments-list-table.php
@@ -525,14 +525,15 @@ class WP_Comments_List_Table extends WP_List_Table {
comment_author_email_link();
echo '
';
}
- echo '';
- comment_author_IP();
- echo '';
+
+ $author_ip = get_comment_author_IP();
+ if ( $author_ip ) {
+ $author_ip_url = add_query_arg( array( 's' => $author_ip, 'mode' => 'detail' ), 'edit-comments.php' );
+ if ( 'spam' == $comment_status ) {
+ $author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
+ }
+ printf( '%s', esc_url( $author_ip_url ), $author_ip );
+ }
}
}