Here are the easiest ways to display WordPress comment count

Are you publishing engaging content or running a forum? You must be finding the easiest way to display your total comment count. We know by doing this you can encourage more users to join the conversation. But, unfortunately, WordPress doesn’t have an inbuilt feature to display WordPress comment count on your website. You need to either use a plugin or add a few lines of codes into your theme’s function file.

In this article, we will show you both the methods to display the total number of comments on your WordPress website.

Method 1. Display WordPress Comment Count by using Plugin

This is an ideal and easy way for WordPress beginners, who want to display comments on their website.

All you need to do is to install Simple Blog Stats plugin from the WordPress directory and activate it. Once activated, you will find the Simple Blog Stats under Settings options. Next, you need to configure plugin settings which is quite simple.

You will also see all the shortcodes that you can use to show different stats such as the total number of comments, registered users, categories, tags, and much more.

For example, you need to copy the shortcode [sbs_approved] to display the total number of approved comments on your WordPress site. The shortcode can be used in any WordPress post, page, or text widget.

Method 2. Display WordPress Comment Count by manual Code

For this method, you are going to have to the add following code to your WordPress files manually.

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');

You are going to have to add the above code to your function.php file. This code will generate a shortcode to display the total number of approved WordPress comments on your site.

Next, you can use the shortcode [wpb_total_comments] in your WordPress posts, pages, or text widget to display the total number of comments on your site.

Consider reading our other article to install and setup Yoast SEO Plugin for better performance in 2018

We believe, this article was helpful to you. If you liked this article then please share this over your social media. Your shares will help us to reach more users like you.

SEE ALSO: How to Remove The Screen Options Button from WordPress Dashboard Area

LEAVE A REPLY

Please enter your comment!
Please enter your name here