Title: Count Post Views with Comment Count
Last modified: August 22, 2016

---

# Count Post Views with Comment Count

 *  Resolved [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/)
 * Hello,
    cause I dont use comments on my site I thought I can use `wp_update_comment_count()`
   to count my post views. So everytime a visitor views a page I like to have the
   comment get one more. So this is easier to present the most popular page in most
   of the themes, cause they work with this commetent stuff.
 * Does anyone knows how I can put code into my header.php so that it rises the 
   comment count when the page is loaded?
 * Thanks,
    Denis

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768431)
 * Hey there Denis,
 * Hope you’re well! 🙂
 * I suggest you use this plugin instead: [https://wordpress.org/plugins/wp-statistics/](https://wordpress.org/plugins/wp-statistics/)
   the function you mentioned just update the comment count of each post not the
   views. Let me know what you think.
 * Looking forward for your reply! 🙂
 * Take care,
    Calvin
 *  Thread Starter [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768458)
 * Hey Calvin,
    nice plugin, but its too much for me.
 * > just update the comment count of each post
 * This is what I need, a function that rises the comment count everytime a visitor
   visits a post.
    This is easier for me to use. cause lots of premium themes use…
   most popular posts depending on comment count. But I dont use comments, or only
   a few people comment so there will be no changes in the list. Now I thought if
   I could use the comment count to populate popular post because of the visits (
   every visit rises the comment count).
 * So tihs makes it easy to use premium themes…without customize the wp-query 🙂
 * Cheers,
    Denis
 *  [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768489)
 * Hey there Denis,
 * Hope you’re well! 🙂
 * Did you mean that the comment count will increase as soon as a user visit your
   post?
 * What about you check the methods here:
 * [http://smartwebworker.com/203-wordpress-show-number-of-page-views/](http://smartwebworker.com/203-wordpress-show-number-of-page-views/)
   or
    [http://wordpress.stackexchange.com/a/35032/60320](http://wordpress.stackexchange.com/a/35032/60320)
 * Looking forward for your reply! 🙂
 * Take care,
    Calvin
 *  Thread Starter [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768495)
 * Hello Calvin,
    I found these pages, too. But this is not what I need. All these
   examples need To have a query depending on custom fields. And I need to create
   a new template. I just want TO use comment count. Cause lots of themes offer 
   ORDERBY comments. So I dont need to create some New tempalte to display the most
   likes posts. Cause i count the views with rising the number of comments. Cheers,
   Denis
 *  Thread Starter [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768613)
 * Hello,
    any one knows, how to use the `wp_update_comment_count()` ? I there something
   I need to add if I want to add a comment to the post without really adding a 
   comment? Cheers, Denis
 *  [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768647)
 * Hey there Denis,
 * Hope you’re well! 🙂
 * I don’t suggest this and I don’t think this is a good way to track pageviews.
   This could get a lot of stuff in your database.
 * I hope you understand.
 * Best Regards,
    Calvin
 *  Thread Starter [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * (@deniscgn)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768664)
 * Hey Calvin,
    thanks…yes, you are right. But when I count by custom field, I need
   to change the theme. or create a custom template to show the post. Maybe this
   weekend I try around with the suggestion. Cheers, Denis

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Count Post Views with Comment Count’ is closed to new replies.

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 7 replies
 * 2 participants
 * Last reply from: [DenisCGN](https://wordpress.org/support/users/deniscgn/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/count-post-views-with-comment-count/#post-5768664)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
