Learn to display number of comments in WordPress Content Management System167

Author: InfoBeep - August 3, 2017 | subject to copyright

In this article, we will provide you guide so that you can display the total number of comments in WordPress:

Method 1: Display WordPress Comment count with a plugin

In order to display WordPress comment count with a plugin, follow the steps below:

  1. Install and activate Simple Blog Stats

  2. After activated, Goto Setting > Simple Blog Stats. This plugin shows your blog stats using shortcodes and template tag. Demo picture is shown below:
  3. As shown in the figure above, you need to copy
    shortcode[ibs_approved]

    to display a total number of approved comments on your site.

Note: you can use this code in any WordPress post, page or text widget.

Method2: Display WordPress comment count with code

This method could be quite difficult for you as you need to add code to your WordPress site. But still, if you want to display comment count without the use of plugin then you may follow the steps below:

  1. Copy the code below to your theme’s functions.php file or a site-specific plugin.
function ibsam_comment_count() {
$comments_count = ibsam_count_comments();
$message =  'There are <strong>'.  $comments_count.' approved </strong> comments found.';
return $message;

add_shortcode('ibsams_comment_count','ibsam_comment_count');
add_filter('widget_text','do_shortcode');

Note: this code creates a function that outputs a total number of approved WordPress comments on your site.