WP Discourse showing wrong links to forum

I’m not exactly sure when this started happening. We’ve been using discourse and WP discourse for a few years and never had any issues before.

The comment links below a post sometimes show the wrong URL. For example, here’s a post:

Linked to the correct forum topic:

discourse-post-linked

But showing the wrong URLs under the post:

This is the wrong topic it links to:

I have no clue why it’s doing this, so I checked some of the WP discourse webhook settings:

/wp-admin/admin.php?page=wp_discourse_options&tab=webhook_options

Never used these before, so I enabled some:

  • Sync Comment Data
  • Match Old Topics

Created the webhook, secret key, and verified that the delivery status is “Successful”.

Doesn’t make any difference though. How can I debug this or figure out why it’s showing the wrong URLs? Anything I am missing?

Thanks for your help!

Rene

2 Likes

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.

1 Like

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.

3 Likes

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 :sweat_smile:

We did customize it with some custom functions, but I disabled that. I should have mentioned this, also we changed the theme awhile ago.

Might that have triggered something? Is it possible to reset the linked topics so that it automatically links the topics again perhaps?

This only happens with some posts, if I could manually fix them that would also work.

Cache comment HTML is disabled.

1 Like

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?

Hi Simon,

Just tested this. Unlinked the topic, saved the post, linked it again, saved the post. Same result.

I’ll send you a PM :slight_smile:

Rene

1 Like