Get the Average Number of Comments Per Post in WordPress

Comments are often a good metric of how engaged your readers are. The more comments you get per post, the better you are doing as a blogger. If you get a high average of comments per post, then your readers are interesting in your content, they’re reading it through, and they want to discuss the topic more.

Wouldn’t it be a neat trick if you could total up the average number of comments per post on your blog? It’s not too hard. WP Recipes has a little code snippet that does just that.

$count_posts = wp_count_posts();
$posts = $count_posts->publish;

$count_comments = get_comment_count();
$comments  = $count_comments['approved'];

echo 'Average '.round($comments/$posts).' comments per post.';