Stats Widget for Blogger Blogs: Total Posts, Comments & Page Views


New Custom Blogger Stats widget on your blog will show Total Posts, Total Comments and Total Pageviews. This widget is originally developed by Duy Pham and here I am just presenting his widget with a new look after some changes in cascade style sheets (CSS). I hope my readers will love Duy Pham’s wonderful effort and my design. This script is very light and does not slow down your blog’s page speed. This widget works by fetching necessary data from your blog feed. So make sure your feed is open for public access. If you have any further query please communicate via comment(s).

Custom Blogger Stats

Click Here to See Live Virtual Demo

How to Install Custom Blogger Stats Widget…

Before doing necessary changes please learn more about basics of Blogger template editing

Step 1. Add the following CSS code before ]]></b:skin> in your template and Save template

#Stats1 ul{margin:0;border:0;padding:0;height:32px;background:url(// no-repeat 0 -34px}
#Stats1 li{margin:10px 0;border:0;padding:0 0 0 40px;list-style-type:none}
#totalComments{height:32px;background:url(// no-repeat}
#totalCount{height:32px;background:url(// no-repeat 0 -68px}

Step 2. Now go to Layout (Page Elements) and add Stats widget after that save the position of the widget

Step 3. Now again we’ll edit the Blogger template / HTML so search for similar code given below

<b:widget id='Stats1' locked='false' title='Total Pageviews' type='Stats'/>

and change this searched code with the following code

<b:widget id='Stats1' locked='false' title='' type='Stats'>
<b:includable id='main'>
<div class='widget-content'>
<h4 id='Stats1_totalPosts'>&amp;hellip;</h4>
<li id='totalComments'>
<h4 id='Stats1_totalComments'>&amp;hellip;</h4>
<li id='totalCount'>
<h4 expr:id='data:widget.instanceId + &quot;_totalCount&quot;'>&amp;hellip;</h4>
<script type='text/javascript'>
function totalPosts(json){document.getElementById('Stats1_totalPosts').innerHTML=json.feed.openSearch$totalResults.$t};function totalComments(json){document.getElementById('Stats1_totalComments').innerHTML=json.feed.openSearch$totalResults.$t};document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&max-results=0&callback=totalPosts\"><\/script><script type=\"text/javascript\" src=\"/feeds/comments/default?alt=json-in-script&max-results=0&callback=totalComments\"><\/script>');

1. DO NOT Expand Widget Templates for changes.
2. Depending on the primary language of your blog title ‘Total Pageviews’ in Step 3 can be different.


          • hi, i think the widget has a problem..
            i tried many times but it works but it is corrupted.
            it is behind my other widget… plelase help me out

          • It is not bug in my widget it is in your template. I have fixed it according to your template. I will suggest you to buy a premium template from us, we’ll customize it to you for $25.

    • We fixed this widget again working, Sorry for delay.

      Please make sure your blog is public. Otherwise widget will not work.
      We have made some changes in code. So please use new javascript.
      This widget is working you can check this blog –


Please enter your comment!
Please enter your name here