3

I just updated a site from EE1 to EE2 that had pretty much nothing but spam comments. I deleted all the comments with a query:

DELETE FROM exp_comments WHERE status = 'o';

But on the blog listing page, the {comment_total} tag is still showing that comments exist. For example:

<a href="{path='blog/post'}">{comment_total} Comment(s) &raquo;</a>

Returns

4 Comments »

Even though there are no comments in the database for that entry.

I also went into the exp_channels table and set the total_comments column to 0 for the blog channel.

When I upgraded from EE1 to 2, I opted to convert trackbacks to comments, could that be what's causing the phantom comments? There's no exp_trackbacks table anymore, so I'm not sure where they might be hiding.

I guess ultimately what I need to know is where does EE get its comment_total count from?

4

Have you tried CP > Tools > Data > Recount Statistics?

1
  • That did it, thanks! I have never used that tool before now. – kmgdev Feb 26 '13 at 16:13
2

Total comments are actually stored in the exp_channel_titles data table, so you would either need to use the Recount Statistics Tool, as @Ryan Masuga suggested or set the comment_total field in exp_channel_titles equal to zero, using a MySQL query. The Recount Statistics tool is the easiest method, unless you don't want all comment numbers to be reset.

1
  • Good info, thanks! Ryan got there first so he got the accept, but thank you for answering! – kmgdev Feb 26 '13 at 16:16
1

It's possible the page is cached so it's worth clearing the cache to eliminate that as the issue.

CP Location: Tools ‣ Data ‣ Clear Caching

1
  • 1
    I already tried that with no success, but it's always a good suggestion, thanks! – kmgdev Feb 26 '13 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.