Title: Comment count always zero
Last modified: August 19, 2016

---

# Comment count always zero

 *  Resolved [Susan](https://wordpress.org/support/users/shoesie/)
 * (@shoesie)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/comment-count-always-zero/)
 * The comment count on my blog is zero for every post even those that have 1, 2
   or more comments.
 * All of these functions think there are no comments:
    comments_popup_link and 
   comments_number
 * but.. all the comments are still displayed properly.
 * I have no idea how to fix this. Any ideas?

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

 *  [Charla](https://wordpress.org/support/users/webgirl/)
 * (@webgirl)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-count-always-zero/#post-1062358)
 * Will mind sharing how this was resolved?
 *  [Chintaru](https://wordpress.org/support/users/chanty87/)
 * (@chanty87)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/comment-count-always-zero/#post-1062359)
 * I have the same issue after importing a xml backup, but I found a solution:
 * Paste this in your functions.php in your theme’s folder:
 *     ```
       add_filter('get_comments_number', 'comment_count', 0);
       function comment_count( $count ) {
       if ( ! is_admin() ) {
       global $id;
       $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));
       return count($comments_by_type['comment']);
       } else {
       return $count;
       }
       }
       ```
   
 *  [Trisha Cupra](https://wordpress.org/support/users/trishacupra/)
 * (@trishacupra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-count-always-zero/#post-1062376)
 * This works beautifully!
 * I’m sharing this solution on all the other unresolved threads and on blogs I 
   found (in my search for this solution) where other people are having this problem
   but couldn’t find a fix.
 *  [jtlowe22](https://wordpress.org/support/users/jtlowe22/)
 * (@jtlowe22)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/comment-count-always-zero/#post-1062382)
 * I experienced the same problem when importing a WordPress 2.5 export into WordPress
   2.9
 * Thanks for the solution.

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

The topic ‘Comment count always zero’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 5 participants
 * Last reply from: [jtlowe22](https://wordpress.org/support/users/jtlowe22/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/comment-count-always-zero/#post-1062382)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
