# Create topic when a link is clicked

**URL:** https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935
**Category:** Support
**Created:** [2017 年8 月 28 日 15:01 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935 "2017-08-28T15:01:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Rob\_Nicholson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_nicholson/32/63483_2.png) [@Rob\_Nicholson](https://meta.discourse.org/u/Rob_Nicholson)
#### Post date: [2017 年8 月 28 日 15:01 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935/1 "2017-08-28T15:01:48Z")

</div>

Yet another random thought. CAMRA uses Discourse. It’s recently also launched a news site running on WordPress. Here is an example article:

> **[CAMRA calls for new business rate relief for pubs](https://wb.camra.org.uk/2017/08/06/camra-calls-for-new-business-rate-relief-for-pubs/)**
>
> CAMRA is calling on the Government to stop viable community pubs from being driven out of business by introducing a £5,000 annual reduction on their r...

As you can see, there is the standard WordPress comment system at the bottom. I’ve suggested that there is some merit in trying to bring those comments into Discourse - mainly so that discussions are more centralised and (maybe more importantly) moderated.

So the requirement would be for a link to be added to the WordPress article that when clicked either a) prompts the user to start a new topic in Discourse or b) opens the existing topic if it’s already been created. More importantly, one doesn’t want to have to create the Discourse topic manually for each article when the majority of them might never be commented on.

Is this kind of thing a) possible out of the box, b) feasible with some custom development and c) not really possible cleanly?

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2017 年8 月 28 日 15:05 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935/2 "2017-08-28T15:05:11Z")

</div>

Topics are automatically created when you use the embedded comments feature:

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963):
>
> Discourse has the ability to embed the comments from a topic in a remote site using a Javascript API that creates an IFRAME. For an example of this in action, check out [Coding Horror’s blog](http://blog.codinghorror.com/welcome-to-the-internet-of-compromised-things/#discourse-comments). The blog is run via [Ghost](https://ghost.org/) but the comments are embedded from his [Discourse forum](http://discourse.codinghorror.com/t/welcome-to-the-internet-of-compromised-things/3550). One important thing to note with this setup is that users have to navigate to your forum to post replies. This is intentional, as we feel that the posting interface on a Discourse forum is currently much richer than what we …

See articles on [https://blog.codinghorror.com](https://blog.codinghorror.com) for an example

For Wordpress setting this up can be done with the Wordpress plugin:

> [@WP Discourse 1.4.0 Release](https://meta.discourse.org/t/wp-discourse-1-4-0-release/65283):
>
> Version 1.4.0 of the [WP Discourse](https://github.com/discourse/wp-discourse) is now available in the [WordPress plugin repository](https://en-ca.wordpress.org/plugins/wp-discourse/). The code is also on [GitHub](https://github.com/discourse/wp-discourse). The big changes in this release are adding an option to sync Discourse topics to their associated WordPress posts with a webhook, and adding support for connecting a single Discourse forum to a WordPress multisite network. Check out the [Webhook Settings](https://meta.discourse.org/t/wp-discourse-plugin-installation-and-setup/50752#wpdc-webhook-settings) and [Multisite Support](https://meta.discourse.org/t/wp-discourse-plugin-installation-and-setup/50752#wpdc-multisite-support) sections of the [WP Discourse installation and setup](https://meta.discourse.org/t/wp-discourse-plugin-installation-and-setup/50752) topic for details about both of these features. Other c…

---

<div class="post-metadata">

### Author: ![Rob\_Nicholson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_nicholson/32/63483_2.png) [@Rob\_Nicholson](https://meta.discourse.org/u/Rob_Nicholson)
#### Post date: [2017 年8 月 28 日 15:10 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935/3 "2017-08-28T15:10:27Z")

</div>

That’s definitely barking up the right tree, but this bit might be a problem at first glance:

> If you set this up correctly, the first time you visit [http://example.com/blog/entry-123.html](http://example.com/blog/entry-123.html) it will try to load comments for the blog post. Since there are none, it will tell the Discourse forum to create a new topic in the background. A new topic will be created by eviltrout and the contents of the first post will be crawled from your blog and the text will be extracted automatically.

That means that the topic will be created in Discourse when the first person opens the article? For Coding Horror that’s fine because I doubt there has ever been a Coding Horror blog article that’s not generated comments.

I’ll read the rest of the instructions later as I appreciate, this might be covered later.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019 年9 月 7 日 06:17 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935/4 "2019-09-07T06:17:18Z")

</div>



---

<div class="post-metadata">

### Author: ![ahmadabdolsaheb](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmadabdolsaheb/32/138662_2.png) [@ahmadabdolsaheb](https://meta.discourse.org/u/ahmadabdolsaheb)
#### Post date: [2019 年9 月 30 日 06:31 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935/5 "2019-09-30T06:31:19Z")

</div>

你找到解决方案了吗？

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023 年5 月 24 日 23:42 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935/6 "2023-05-24T23:42:53Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2023 年5 月 25 日 06:21 UTC](https://meta.discourse.org/t/create-topic-when-a-link-is-clicked/68935/7 "2023-05-25T06:21:41Z")

</div>


