(+84) 463.28.7979

How to fix WordPress.com Stats plugin showing zero (0) visitors!


This article explains how to fix WordPres.com Stats plugin when it doesn’t show any statistics for your site or shows 0 visitors.

I recently installed WordPress.com Stats Plugin on one of my sites. WordPress.com Stats provides statistics on most popular metrics about the visitors to your site. Unfortunately, for some reason the plugin wasn’t working properly. It was showing zero (0) visitors for each day (which was wrong) and all the other stat blocks like “Top posts & Pages”, “Clicks” etc were empty. I tried many things like deactivating, deleting and then reactivating after uploading a new copy of the plugin to address this issue. I even used a different API key to see if that works. None of these methods worked. It was really surprising to me as the plugin works fine on two of my other sites. Anyway, after spending a lot of time trying to fix this issue I decided to read the Frequently Asked Questions (FAQ) section and found the answer to the problem. *hint* always read the FAQ section :)

Here is what you have to do to address this issue if you are having a similar problem.

Insert the following line in your “footer.php” file of your template at the very bottom right before the </body> tag.

<?php wp_footer(); ?>

Example of a “footer.php” file

<div id=”footer”>
<p><a href=”<?php bloginfo(‘url’); ?>”><?php bloginfo(‘name’); ?> – Example text</a></p>
</div>
<?php wp_footer(); ?>
</body>
</html>

The reason it was working on my other sites from the start was because the themes used by default had that function call in the “footer.php” file. Hope this helps solve your WordPress.com Stats Plugin issue.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>