The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Why are commenter I...
 
Share:
Notifications
Clear all

Question [Solved] Why are commenter IP addresses suddenly missing?

3 Posts
2 Users
1 Reactions
136 Views
Posts: 4
Topic starter
(@mikemynis)
Active Member
Joined: 5 years ago

After I updated my WP and WP Discuz to the latest versions (as per today oct, 29th 2025), I noticed that the IP addresses of comments are missing. Up until yesterday the IP addresses were visible, but now they're gone. Any idea what happened and how to get the IP's back? I use them to filter out trolls.

image

2 Replies
Posts: 4
Topic starter
(@mikemynis)
Active Member
Joined: 5 years ago

Aaargh, it's enforced 'privacy' in WP core. That makes me sick. I MUST know and identify trolls.

FIX it by adding this to your theme's functions.php file. It will ADD a column with the IP.:

// 1. Add the column header
add_filter( 'manage_edit-comments_columns', function( $columns ) {
// Insert right after the "Author" column
$new = array();
foreach ( $columns as $key => $title ) {
$new[ $key ] = $title;
if ( 'author' === $key ) {
$new['comment_ip'] = 'IP Address';
}
}
return $new;
} );

// 2. Fill the column
add_action( 'manage_comments_custom_column', function( $column, $comment_id ) {
if ( 'comment_ip' !== $column ) {
return;
}
$comment = get_comment( $comment_id );
$ip = $comment->comment_author_IP ?? '';

echo $ip ? esc_html( $ip ) : '<span style="color:#aaa;">—</span>';
}, 10, 2 );

 


Asti
Posts: 8181
 Asti
Support
(@asti)
Illustrious Member
Joined: 8 years ago

Thank you for letting us know. Glad to hear that the issue is solved.

We're going to mark this thread as resolved. Feel free to open a new topic if you have further questions.


Share: