Title: comment count zero after import
Last modified: August 19, 2016

---

# comment count zero after import

 *  [kcmartin](https://wordpress.org/support/users/kcmartin/)
 * (@kcmartin)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/)
 * I couldn’t find an adequate solution to this in the forum so am hoping that someone
   can help me!
 * After importing posts from another wordpress blog the comment count has been 
   set to zero, even if there are comments on a post. The comments are not disabled
   either.
 * The comment count is working fine for all posts created since the import.
 * How can I reset the comment count for the imported posts?

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

 *  [Tommie Hansen](https://wordpress.org/support/users/tommiehansen/)
 * (@tommiehansen)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307561)
 * I wonder this to. The problem is obviosly that some values are left out in the
   db. :f Got the same problems but with local avatars not being set to new ones
   for old users etc.
 * Some re-count feature would fix it.
 *  [ddysart](https://wordpress.org/support/users/ddysart/)
 * (@ddysart)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307568)
 * +1 on this one. I have a blog I support where I’m seeing this.
 *  [Trisha Cupra](https://wordpress.org/support/users/trishacupra/)
 * (@trishacupra)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307571)
 * I had this problem today, too, and found the solution at [http://wordpress.org/support/topic/265655](http://wordpress.org/support/topic/265655)
 * Here is the solution:
 * Add this code to your Theme’s functions.php file…
 *     ```
       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;
       }
       }
       ```
   
 * All fixed!
 *  [burpexcuzme](https://wordpress.org/support/users/burpexcuzme/)
 * (@burpexcuzme)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307573)
 * It’s still not working for me! 🙁
 *  Thread Starter [kcmartin](https://wordpress.org/support/users/kcmartin/)
 * (@kcmartin)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307593)
 * Thank you Trisha! It worked to the extend that my posts now show the correct 
   comment count. However, my archives still don’t for those posts that I imported,
   see here [http://www.gipsylife.com/archives/](http://www.gipsylife.com/archives/).
   If you expand all posts you can see that everything after May 2009 shows a (0)
   count even though there are comments. I guess this now is a problem with the 
   plug-in *sigh*. Wish I was more technical!
 *  [freshmess](https://wordpress.org/support/users/freshmess/)
 * (@freshmess)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307620)
 * Hi trishacupra, at which part in the functions.php file do I insert that code?
   When I pasted this code on the functions.php (removing everything that was in
   there first), it turns into an error message, even my blog only displays that
   error message. Please help? Thanks!
 *  [freshmess](https://wordpress.org/support/users/freshmess/)
 * (@freshmess)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307621)
 * Got it!
 *  2010
 * [16 years, 3 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307622)
 * Thanks trishacupra! it works!

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

The topic ‘comment count zero after import’ is closed to new replies.

## Tags

 * [Import](https://wordpress.org/support/topic-tag/import/)
 * [zero](https://wordpress.org/support/topic-tag/zero/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 7 participants
 * Last reply from: 2010
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/comment-count-zero-after-import/#post-1307622)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
