Issues with Ghost+Discourse comments (migrating from WordPress likewise)

I’m in the middle of trying to migrate my blog from WordPress (with Discourse comments) over to Ghost (with Discourse comments), and while having set up comments using the instructions at Official Ghost + Discourse Integration, I’ve run into a bunch of issues to resolve, if you’ll indulge me:

  1. In the embedding settings, I have not checked “Imported topics will be unlisted until there is a reply”, but when I go to a new post and it creates the matching topic, it is indeed unlisted until a comment’s made. Is there a way to avoid this and have the topics created and listed as they are posted to Ghost?

Also, if I’ve misunderstood what that setting’s supposed to do, what does it actually do?

(Despite being advised otherwise, various of my readers insist on using the Discourse community as their source for new posts, rather than the blog itself, and I need to support them.)

  1. When the blog was a WordPress blog, I was using the WordPress Discourse plugin. When it created topics to match the blog posts, they came through to Discourse as if links had been posted there, as can be seen in the middle topic here:

Is there a way to modify the embedding code/settings to get that behavior back again? It was both a useful link from the index and a clear distinguisher of “comment” posts vs. “community” posts?

  1. Most importantly, when I go to a post that had existing Discourse comments (via the WordPress plugin), the comments section on the page sticks at “Loading Discussion…” forever. I had expected, and of course it’s rather crucial, that such embeds would link to the existing topic matching that URL. Has anyone figured out a way to make that happen?

(See, for example, Spooooky and its corresponding topic Spooooky - General - The Eldraeverse .

Any assistance with these would be very much appreciated!

I’d need to look more closely at the code, but I think, from the Discourse side, you just need to see that the URL in the embed record (can’t remember exactly what it’s called) has the same URL as your new site passes to it.

So, I think as long as the discourseEmbedUrl on the new embed site matches the new one (or you change it in the record on Discourse), you’ll be OK.

  DiscourseEmbed = {
    discourseUrl: 'https://discourse.example.com/',
    discourseEmbedUrl: '[EMBED_URL](http://example.com/blog/entry-123.html)',
    // className: 'CLASS_NAME',
  };
1 Like

Unfortunately, as far as I can tell, it is. I looked at the blog page in the dev tools, and see this where the Discourse comments go:

showing a discourseEmbedUrl parameter in the script of

https://eldraeverse.com/2024/10/28/spooooky/

and on the Discourse topic, I’m seeing that same URL both in the link at the top of the topic, and in the “Originally published at:” insert into the first topic post. (Not sure if there’s somewhere else specific I should be looking in Discourse for the original embed record, but everything I can see in the topic itself matches.)

Edit: To clarify, I was previously using the WP Discourse plugin, and as that isn’t configured using the embedding config on Discourse, I can’t just go and look at the old setting, unfortunately. But I made sure all the topic-page URLs on the new Ghost blog wouldn’t change from the WordPress blog, so everything should be the same automatically.

In Rails, you can look at

 TopicEmbed.all

or

 TopicEmbed.pluck(:topic_id, :embed_url)

to see what’s there and if that matches yours you should be good to go, but it’s not loading, which, I think, suggests that you haven’t allowed your other site to do embeds on your Discourse.

On the former, I don’t think I have access to run that, as my Discourse is hosted by y’all, or at least I don’t know how I would.

On the latter - I’m not sure I follow you. My embedding config is:

which should match the URLs of both the old site and the new site, surely? Apart from the post-specific slug at the end, the URLs of the posts which fail to load the comment topic are identical to those of the posts which succeed in doing so?

Oh. Sorry. I mostly think only of self- (or me-) hosted. You might be able to do something like that with the data explorer plugin if you’re on Business hosting.

You could try turning on embed any origin and see if that fixes it. Worst case, I think , you should get the embed to load and it won’t have the comments you expect to see.

Alas, a humble pro bono user. SF writing is sadly not as lucrative as I wish it could be. :smile:

I tried embed any origin, but alas, no change in behavior.

(I’ve also looked at the source code for the WP Discourse plugin, which seems to only be talking to the Discourse API to do its thing and not using the normal embedding support at all, which now I’ve seen how Discourse embeds look in Ghost is not surprising - the comments in the old WordPress looked and behaved differently.

So now I have to wonder if there is any embed URL recorded for those topics on the Discourse side at all - although that begs the question of why I’m not simply seeing new (embed) topics appear now instead of this breakage - and if there’s any way I could add one to them?)

1 Like

I did a quick experiment: if I delete a topic created by the WP Discourse plugin, subsequently visiting that same post on the Ghost blog causes a new topic for that post to be created via embedding, so evidently the WP Discourse topics are capable of blocking the embeds from functioning even if they don’t display.

Of course, that’s not a viable solution, but it is a data point.