# Embedding Discourse content in remote pages, like a wiki

**URL:** https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834
**Category:** Feature
**Created:** [May 14, 2015, 10:19pm UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834 "2015-05-14T22:19:54Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![trilson](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@trilson](https://meta.discourse.org/u/trilson)
#### Post date: [May 14, 2015, 10:19pm UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/1 "2015-05-14T22:19:54Z")

</div>

A bit of a long shot, but thought it worth asking. Would it be possible (or is it currently possible) to embed certain types of discourse content in remote pages, similar to how comment embedding works? It’d be great if I could create a community wiki on our discourse site and subsequently embed it on a static site elsewhere.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 15, 2015, 7:32am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/2 "2015-05-15T07:32:30Z")

</div>

Technically it is extremely easy to grab the data: [Embedding Discourse content in remote pages, like a wiki](https://meta.discourse.org/t/embedding-wiki-pages/28834.json) we have a natural json endpoint for each post and topic you could use. So all you really need to add is a few lines of javascript to pull the content and render it.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [May 15, 2015, 9:17am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/3 "2015-05-15T09:17:38Z")

</div>

I’ve been thinking about this kind of workflow too. Just FYI, I think this could work very well the other way around as well.

1. Create a new [Onebox](https://github.com/discourse/onebox) engine for your wiki that would display the full page instead of an excerpt.
2. Use Discourse as comments for your wiki pages.
3. Put the wiki-page’s URL in its respective Discourse thread so that it’s oneboxed.

---

<div class="post-metadata">

### Author: ![trilson](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@trilson](https://meta.discourse.org/u/trilson)
#### Post date: [May 15, 2015, 6:22pm UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/4 "2015-05-15T18:22:18Z")

</div>

This looks like what I need, however it appears to return the entirety of the thread rather than a single post. Is there anything I’m missing here? This would be too heavy if there are lots of replies.

I’m also getting the below error when attempting to embed - any workaround for this?

> XMLHttpRequest cannot load [https://community.muselive.com/t/index-of-b-sides-rare-tracks/73065.json](https://community.muselive.com/t/index-of-b-sides-rare-tracks/73065.json). No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘[http://www.muselive.com](http://www.muselive.com)’ is therefore not allowed access.

---

<div class="post-metadata">

### Author: ![trilson](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@trilson](https://meta.discourse.org/u/trilson)
#### Post date: [May 15, 2015, 6:33pm UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/5 "2015-05-15T18:33:48Z")

</div>

After doing a bit of reading, I reckon I might be able to add some rules to support [muselive.com](http://muselive.com) with this plugin… currently using it support X-Frame-Options but hopefully extendible.

> <https://github.com/trilson/discourse-xorigin/blob/master/plugin.rb>

---

<div class="post-metadata">

### Author: ![trilson](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@trilson](https://meta.discourse.org/u/trilson)
#### Post date: [May 15, 2015, 10:35pm UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/6 "2015-05-15T22:35:41Z")

</div>

Update: it works 😄 - example ‘static’ [page](http://www.muselive.com/test-discourse-embed/) includes [this](https://community.muselive.com/t/index-of-b-sides-rare-tracks/73065) wiki.

However… I’m still fetching all replies for given a topic’s .json. Is there a way for me to fetch the first post only?

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [May 19, 2015, 9:32am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/7 "2015-05-19T09:32:58Z")

</div>

I see the page is now returning a 404. Did you terminate it because of the problem with fetching replies or did you encounter other issues as well?

Unfortunately I can’t help you figure these kinks out, but I’m fascinated with this workflow and would love to know more about it. Regardless of where you’re at with it at the moment, could you tell me what you imagine your final workflow to be like?

- Could any topic in any category be connected to a remote page, or would you limit it to a specific category?
- How would new remote pages be added?..
- strictly at your (and other admins) discretion?
- or have you pondered ways to automate it? (i.e. users could type
- Will you be doing any kind of [SEO canonicalization](https://support.google.com/webmasters/answer/66359?hl=en) in order to indicate your preferred page and avoid possible penalties?

If this workflow gets smoothened out, it could be a great way run [a community-powered Discourse wiki](https://meta.discourse.org/t/proposing-jekyll-as-community-wiki-platform/9873).

---

<div class="post-metadata">

### Author: ![trilson](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@trilson](https://meta.discourse.org/u/trilson)
#### Post date: [May 19, 2015, 10:04am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/8 "2015-05-19T10:04:43Z")

</div>

Sorry, I changed the URL to [http://www.muselive.com/b-sides-and-rare-tracks/](http://www.muselive.com/b-sides-and-rare-tracks/).  
Will respond to your other points when I’m back from work 🙂

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [May 21, 2015, 11:07am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/9 "2015-05-21T11:07:53Z")

</div>

_nudge!_

I’m still really curious 😃

---

<div class="post-metadata">

### Author: ![Matthieu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matthieu/32/107885_2.png) [@Matthieu](https://meta.discourse.org/u/Matthieu)
#### Post date: [June 10, 2015, 10:06am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/10 "2015-06-10T10:06:45Z")

</div>

Hi I would like to have exactly the same feature but to be embedded on a wordpress page.  
Any idea how it could be possible ?

@trilson what techno are you using to build [muselive.com](http://muselive.com) ?

---

<div class="post-metadata">

### Author: ![Matthieu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matthieu/32/107885_2.png) [@Matthieu](https://meta.discourse.org/u/Matthieu)
#### Post date: [June 16, 2015, 10:06am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/11 "2015-06-16T10:06:30Z")

</div>

Actually I find a way to do it using AngularJS:

> **[Publishing forum content on poppy-project.org](https://poppy.discourse.group/t/publishing-forum-content-on-poppy-project-org/1462)**
>
> Some of you (e.g. @thot, @Comacina) got write permission on the poppy website to post freely their project: https://www.poppy-project.org/projects/ Allow people posting and updating their project on the website is something we would like to...

And I’m working on a wordpress plugin to do it easily with a shortcode.

---

<div class="post-metadata">

### Author: ![Matthieu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matthieu/32/107885_2.png) [@Matthieu](https://meta.discourse.org/u/Matthieu)
#### Post date: [June 20, 2015, 7:24am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/12 "2015-06-20T07:24:39Z")

</div>

I finally take myself to do a wordpress plugin …

> [@Plugin for embedding Discourse topics in wordpress pages or posts](https://meta.discourse.org/t/plugin-for-embedding-discourse-topics-in-wordpress-pages-or-posts/30228/):
>
> Hi, I did a quick and dirty wordpress plugin so you can easily embed topic content in your wordpress pages using a shortcode. It is still beta AND I’m not a webdevelopper so be careful using it for the moment. To use it, you just need to provide the url of your discourse forum in the plugin settings and then add this shortcode [discourse topic\_id='xxx'] in the editor. It will include the first post of the topic as pure html in the wordpress page. I did it so our community can create and maint…

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [December 4, 2025, 11:35am UTC](https://meta.discourse.org/t/embedding-discourse-content-in-remote-pages-like-a-wiki/28834/13 "2025-12-04T11:35:56Z")

</div>


