How to Display the Total Number of Comments on your WordPress Blog

 How to Display the Total Number of Comments on your WordPress Blog

posted in: Blog, Plugins, WordPress | 0

If your blog needs more engagement, one of the best ways is to keep users commenting on your posts. Displaying the total number of comments on your WordPress blog will attract visitors to do so. In this tutorial, we will help you do that with ease.

There are many methods to display the total number of comments on your blog. The easiest method is to use a good plugin. But you can also do some coding to display the comments on your blog.

  1. Use a Plugin to Display the Total Number of Comments on Your WordPress Blog

This method is the easiest and works for most blogs. Visit the WordPress plugin directory and download the ‘Simple Blog Stats’ plugin. Install and activate it. Now, on your WP dashboard, click Settings >> Simple Blog Stats.

total number of comments

The page will now display a list of short codes for the number of posts, number of pages, number of drafts, etc. You should be able to find a short code for ‘approved comments’. Copy the shortcode and use it anywhere you want, in posts, pages, or text widgets. A good idea would be to use the shortcode on a sidebar widget.

  1. Use a Code to Display the Total Number of Comments on Your WordPress Blog

You can also use a code to display the total number of comments on your WordPress blog. Copy the code you find below and paste it in the functions.php file.

function wpb_comment_count() { 

$comments_count = wp_count_comments();
$message =  'There are <strong>'.  $comments_count->approved . '</strong> comments posted by our users.';

return $message; 

} 

add_shortcode('wpb_total_comments','wpb_comment_count'); 
add_filter('widget_text','do_shortcode');

 

The code helps you display the total number of approved comments. The message could be edited as you wish.

These are the methods to display the total number of comments on your WordPress blog. For more tutorials on WordPress, please do subscribe to our blog.

 

Editorial Staff
Follow Editorial Staff:

Editorial Staff

Producing articles, creating content & other great material for the BEST Web Agency in Southern California.

Leave a Reply