Remove Author From Recent Comments Widget

By Default, WordPress recent comment widget displays the comment author name and the title of post where the comment was posted. But, this widget doesn’t come with an option in dashboard to remove comment author name from the widget.

However, you can easily fix this issue by adding a small amount of code to your functions.php file located inside your theme directory.

function ccw_remove_comment_author( $array ) {
	global $post;
	$array['user_id'] = !$post->post_author;
	return $array;
add_action( 'widget_comments_args', 'ccw_remove_comment_author' );

Read Also : Remove Pingbacks from Recent Comments Widget

Leave a Comment.