The user renem is experiencing an issue with WP Discourse where comment links below a post sometimes display the wrong URL. They have checked the WP Discourse webhook settings and enabled “Sync Comment Data” and “Match Old Topics”, but this did not resolve the issue.
renem tried reinstalling the WP-Discourse plugin and recreating settings, as suggested by jtbayly, but this did not work.
simon suggested that the issue might be related to customized comment templates or the “Cache Comment HTML” option, but renem reported that they had disabled the customizations and that the “Cache Comment HTML” option was disabled.
simon recommended unlinking and relinking the post to its Discourse topic, but this did not resolve the issue. renem will send simon a PM with details about the template customizations on the site.
If I were you, the first thing I would try to fix it is uninstall and reinstall the WP-Discourse plugin and then recreate your settings. I’ve had that fix strange problems for me in the past.
It looks like you have customized the comment templates. Have any recent changes been made to this on your site?
Have you enabled the “Cache Comment HTML” option? It’s found on the Comment Settings tab. If you have enabled it, uncheck the setting, enable the “Clear Cached Comment HTML” setting, and then save the options. See if that fixes the issue.
I tried to disable and reactivate it, but that didn’t make any difference. If everything else fails, I’ll wipe its settings and start over but I’d prefer not to start with that
It is a strange issue, because the correct Discourse topic is being displayed in the Discourse metabox on your edit page. This means that the value of the discourse_permalink post metadata is correctly set.
Can you try unlinking and a post to Discourse and then relinking it to its Discourse topic? This will delete and then reset all Discourse metadata that is associated with the post. I don’t expect this to solve the issue, but it would be good to rule it out.
If this doesn’t solve the problem, can you post, or PM me, some details about the template customizations you have on the site?