# How to embed Discourse comments as HTML (not iframe) with a Canonical URL?

**URL:** https://meta.discourse.org/t/how-to-embed-discourse-comments-as-html-not-iframe-with-a-canonical-url/386702
**Category:** Support
**Created:** [October 25, 2025, 1:34am UTC](https://meta.discourse.org/t/how-to-embed-discourse-comments-as-html-not-iframe-with-a-canonical-url/386702 "2025-10-25T01:34:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Turgut\_Ordu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turgut_ordu/32/497803_2.png) [@Turgut\_Ordu](https://meta.discourse.org/u/Turgut_Ordu)
#### Post date: [October 25, 2025, 1:34am UTC](https://meta.discourse.org/t/how-to-embed-discourse-comments-as-html-not-iframe-with-a-canonical-url/386702/1 "2025-10-25T01:34:44Z")

</div>

Hello dear forum members,

I have a product review website and an active Discourse forum connected to it.

**My Goal:** I want to fetch and display the comments (user inputs) from the corresponding topic on my Discourse forum underneath each product page on my review site.

**Current Situation & Undesired Method:** I am aware of Discourse’s feature to embed topics using an `iframe`. However, I believe that content fetched via an `iframe` will not be recognized by search engines as part of my main site (the product review site) and, therefore, will not provide a direct SEO benefit .

**My Ideal Scenario:**

1. When I publish a product page on my review site , a topic (thread) for this product should be automatically created on my Discourse forum.

2. The `canonical` tag of this new topic on the forum should point to the URL of the original product page on my review site. (This is to prevent duplicate content issues).

3. To be able to display the comments (posts) from this forum topic on my product review site using an SEO-friendly method _other_ than an `iframe` (like rendering the content directly into the page’s HTML).

**Why I Want This Method:**

1. To grow the community by directing users from my review site to the forum to make comments.

2. To enrich my review pages with valuable, unique user content (UGC) for SEO purposes, by displaying these forum comments as HTML on my site.

**My Questions:** What is the best way to set up this structure?

- How can I programmatically create a new topic and set its `canonical` URL?

- What is the best technical approach (using API, Webhooks, etc.) to integrate these forum comments (posts) directly into my site’s HTML, without using an `iframe`?

- Is there a known plugin or a “best practice” to achieve this automation (creating a new topic when a new product is published)?

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [November 3, 2025, 7:58pm UTC](https://meta.discourse.org/t/how-to-embed-discourse-comments-as-html-not-iframe-with-a-canonical-url/386702/2 "2025-11-03T19:58:35Z")

</div>

This has been [asked before](https://meta.discourse.org/t/use-discourse-as-a-commenting-system-in-wordpress-but-integrate-natively-not-as-an-iframe/257884?tl=en) but I am not aware of an out of the box way to do this. Perhaps you could do something with RSS feeds, or the API directly?

> [@Get number of comments and/or likes via API per topic?](https://meta.discourse.org/t/get-number-of-comments-and-or-likes-via-api-per-topic/98350):
>
> What is the most efficient way to get the number of comments a topic has received (and perhaps the number of likes, either to first post post or all posts combined) via the API? (I haven’t looked but I guess there is a counter cache which stores number of replies etc? Is it possible to fetch that via the API, rather than load the whole topic, etc?)

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [December 3, 2025, 7:58pm UTC](https://meta.discourse.org/t/how-to-embed-discourse-comments-as-html-not-iframe-with-a-canonical-url/386702/3 "2025-12-03T19:58:47Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
