Blog Stats [Total Posts & Total Comments] Widget

Here’s another simple widget for your blog. With this widget, you can show your live stats (total posts and comments on your blog).
You may change the phrases “Total Posts” and “Total Comments” and the color of the font too.
Follow these instructions to add a similar widget to your blog:
Log in to Blogger, go to “Layout“, click on “Add a Gadget“, and select it as “HTML/JavaScript” type. Now add this code to the widget:

<script style=”text/javascript”>
function numberOfPosts(json) {
document.write(‘Total Posts: <b>’ + json.feed.openSearch$totalResults.$t + ‘</b><br>’);
function numberOfComments(json) {
document.write(‘Total Comments: <b>’ + json.feed.openSearch$totalResults.$t + ‘</b><br>’);
<font color=”red”><script src=””></script>
<script src=””></script></font>

Replace the code in red with your blog’s address.
And you may change the code highlighted in blue to modify the appearance of this widget.

16 thoughts on “Blog Stats [Total Posts & Total Comments] Widget

  1. Dude that blog’s taking too much of time to load, may be because of the number of widgets in it !
    As this widget is very easy to add, and hardly takes time, so I advice you to directly try it out in the final blog where you want to put it….


  2. I am very new to blogging but your site helped me a lot. Thanks very much. I visit your site every to get tips on how to improve my site.I follow your tips one at a time. Thanks again.

  3. Sai Ram Divya,

    I have been using this widget since the day it was posted. But now comments count is not working properly, I mean comments are displayed less as compared to actual ones. Please help.

  4. Yeah that's true, and this is not limited to this widget but the count is faulty in the popular posts widget too. The problem is not with any of these widgets, rather something is wrong at Blogger itself. May be something is being edited in the feedlinks.

  5. I am having problem with this widget. It is not showing the actual total number of comments. It was somewhere is 1000s n now it is showing it in 100s. 🙁

  6. Yes Shas, even I am facing that problem. And that is why I stopped using it. Actually the problem isn't with the widget but with the feed itself. Hope it's just a temporary problem.

  7. Since recent changes on Google, the PageRank checking became an isue, yet it can still be checked by this free tool: . Use the returned seo information wisely and save it as pdf file for refference (look for a button: "Seo Report – Download").

Leave a Reply

Your email address will not be published. Required fields are marked *