jtbayly is experiencing issues with comment count synchronization between WordPress and Discourse. Despite successful webhook logs, the comment count in WordPress remains at zero even after comments are posted in Discourse. angus clarifies the setup and asks for clarification on expected behavior. jtbayly simplifies the issue, stating that the comment count isn’t increasing from zero. angus confirms the Sync Comment Data webhook is set up and suggests enabling verbose logging. jtbayly provides an example where the sync was successful but the comment count still shows zero. angus requests a link to an example post. After reviewing the example, angus explains that the current settings filter comments, affecting the display of the comment count. angus suggests changing the settings to display a link to the comments and disabling the moderator-liked filter. jtbayly confirms the solution works but expresses confusion about the initial assumptions. angus clarifies that displaying both the total comment count and selected replies requires a custom setup not supported out of the box, offering to revisit the issue when jtbayly is ready to implement it.
However, at the bottom of the page it still says “Start the discussion at …” instead of “Join the discussion” even though there is a comment now.
Anybody have any suggestions?
I do have “Only Import Moderator-Liked” selected, but I believe that should only affect which comments are displayed, not the wording or the comment count, correct?
Hey @jtbayly, thanks for the report. I’m trying to understand what you see as the issue here. Here’s what seems to be the case based on what you’ve said:
Publishing posts from Wordpress to Discourse is working properly.
You have the Sync Comment Data Webhook setup (is that right?).
You have “Only Import Moderator Liked” enabled.
You are seeing some sync comment errors in the logs.
When you reply to a post published from Wordpress in Discourse you are seeing the comment count increase but you are not seeing the post appear in Wordpress.
If you ignore the logs for a moment, could you explain what you expect to happen and how the current state diverges from your expectation.
Yes, I do. And I turned on “Verbose Webhook Logs” in WP-Discourse. Interestingly, since then, I’ve had no failures in the logs, but it’s still not working. Here is the most recent entry:
Just a note that @jtbayly kindly shared an example with me via a PM and I’ve taken a closer look at this. @jtbayly I think what you’re seeing is expected behaviour. You have “Only Import Moderator Liked” enabled and the display of comments, including the display of the comment count, are controlled by the filter settings you apply to comments. Unless I’m mistaken, essentially what you want is:
No actual comments to be imported.
Just the comment count to display next to the link to the corresponding topic.
In which case I think the configuration you want is to set “Enable Discourse Comments” to “Display a link to the comments”. You should then disable “Only Import Moderator Liked”.
Thank you for your help, @angus. It does appear changing those settings fixed it. I guess I was confused.
Here is how I assumed it worked:
Comments that were imported would display under the post in WP.
Comment count would include all of the replies to a topic in Discourse.
I had that selected because eventually I was hoping to get around to actually displaying the mod-liked comments below posts. But I guess that’s not possible along with showing the total number of replies to a topic?