Wrong path after update of permalinks - bug?

AI-generated summary

Users discuss an issue where updating permalinks or domain names in WordPress does not automatically update links in Discourse posts, leading to broken links. frold reports that the “Originally published at” link updates when using the “Update Topic” button, but the featured link in the topic header does not. simon confirms this is a known issue and plans to fix it, noting that it requires significant plugin changes. alexwoolfson shares a similar problem after a domain change, and simon announces a fix in WP Discourse 2.0.5, which now updates the featured link when the “Update Topic” button is used, though manual updates are still required for existing posts. alexwoolfson confirms the update resolved his issue.

It seems like when I update the parmalink structure in Wordpress and then update the discourse post both paths to the article is not updated.

The path in the article is:

But not the link in the topic text.

Is that a bug or meant to be this way?

Now I have a deadlink in the topic…

Edit: added link to the post if my text didnt maked sense…

I would expect the “Originally published at” link in the post to be updated if you click the “Update Topic” button on Discourse. The featured link that is in the topic’s header will not be updated though. This is a problem. I’m looking into what can be done to fix it.

It is working good.

Thanks :+1:

Any news regarding this topic?

should it be moved to bugs?

It is a solvable problem, but will require some fairly significant changes to the plugin to get it to work. I’ll try to get it done next week. In the meantime, you can prevent the broken featured links from displaying by disabling the Discourse topic featured link enabled site setting.

Howdy,

I have a Wordpress install that is successfully connected to Discourse using the excellent WP-Discourse plugin. I have just transferred my Wordpress site from its old domain name of webcomics.yaoi911.com to its new domain name of youngprotectors.com. Nothing else has changed, just the domain name, the rest of the URL structure is the same.

But all my Wordpress to Discourse posts are still showing the old URL:

I’d like to change all references to my old domain name to the new domain name in my Discourse install.

I did a search here and found a thread from 2017 which indicated that the best way to do that was through the Rails Console. I’ve never done any edits that way before, but I’m up to learn something new. :slight_smile:

I just wanted to make sure that this is still the preferred method of solving this. I think all I need to do is copy and paste this code into the command line after logging into my rails console:

Am I understanding what to do correctly, @simon? Is that the best way? Will it also change the links in the content of the posts?

Please let me know if you get a chance. Thanks!

Alex

I just pushed WP Discourse version 2.0.5 to the WordPress plugin repo. WIth that update, if the “Add Featured Links” setting is enabled on WordPress, the Discourse featured link will be updated when the “Update Topic” button is clicked on WordPress. The feature link will also be updated if you select the 'Update Discourse Topic" checkbox when publishing posts with the Classic editor.

This should take care the issue that was happening when either a WordPress site’s domain name or permalink structure is changed. It does require you to update each post manually though, so for a site with a lot of posts there could be a fair amount of work involved.

Thank you, Simon. It is a bit labor-intensive, especially because I’ll also need to re-add my comic images to the top of every post, but the new update worked exactly as planned and I really appreciate the quick turnaround.

You rock!

Alex