Setting canonical URL when posting/cross-posting

AI-generated summary

user12 wants to cross-post articles from their personal blog to a public Discourse forum while specifying the canonical URL to avoid duplicate content. They don’t have a plugin available for their static blog and not all posts fit the forum’s topic.

pfaffman suggested using a JavaScript method to embed Discourse comments on the blog, which would handle the canonical URL. However, user12 doesn’t want to use this method as it would embed comments, not just cross-post with a canonical URL.

pfaffman proposed a workaround by hiding the embedded comments with CSS, but user12 also tried pasting the blog URL into the title, which didn’t produce the desired result. The original question about using the API to set a canonical URL remains unanswered.

I have a personal blog, which sometimes have articles that fits another public discourse forum in my language.

Is there a way to specify the canonical URL when posting to discourse?, to avoid showing duplicate content to search engines.
It’s a static blog, so no plugin exists, and not all posts fit the topic of the discourse forum.

It would be great if there is a way to specify the Canonical URL when posting.
I read its possible through the API, I can request an API key from the admins, but what’s the command that I should use to post my topic?

Have a look at Embed Discourse comments on another website via Javascript. I think that will insert the post automatically on discourse and handle the canonical bit.

But I don’t want to use Discourse comments on my website, I just want to cross post with canonical URL set to the origin.

That’s my best idea. You might let it embed the comments and then hide them with CSS. That’s the only way that I can think of.( Though you might see what happens if you paste the blog url into the title?)

Nothing happens, its just normal title text