An extension of the official WordPress plugin for Discourse

We would need to extend the functionality of the official WordPress plugin for Discourse to not create hidden topics in Discourse after publishing an article in WordPress, but only create them based on a real discussion request.

I would like everything to be done with the status of the official WordPress plugin in mind, so that this modification is accepted by the official team.

I am posting the basic working of the modification below. But if you have any suggestions for improvements, I am open to discussion.

  • In WordPress we have a draft article for example
  • we will publish the article
  • still nothing is transferred to Dicourse

Then someone clicks on the “Start a discussion” button under the WordPress article

  • at that point WordPress calls Discource to create a topic with the address
  • and after it is created, it redirects the user to Discourse to post the first comment

If someone on the same WordPress article wants to “add a comment” (another comment)

  • they will no longer call Discourse and create a topic
  • but the user will be taken directly to the Discourse when the button is clicked
  • alternatively the “add comment” button no longer needs to be handled by JavaScript, but since the topic already exists, the button could just be an html link, which would be better from an SEO perspective

I am willing to pay 200-400 USD for these modifications

I require delivery within one month.

The whole discussion on this topic is here An idea for more economical comments? - #6 by Petr_Mišák

1 Like

I’d suggest leaving out the redirect. Just have it so that when the button is clicked, its content is updated to display a loading spinner and text similar to “publishing topic…” Once the topic is published, change the button’s text to something like “visit topic to start the discussion.”

It sounds like Angus is considering adding a “publish to Discourse” shortcode and block to the plugin’s next release: An idea for more economical comments? - #15 by angus. It’s likely that could meet your requirements.


Thanks for the suggestions for improvements.
This would mean that to enter the discussion, the first discussant would have to click the button twice. Is that right? Isn’t that user-unfriendly?

With the plugin and the official update, this is good news. Any idea what date the plugin update is scheduled for?

Yes, with the approach I was suggesting the user would first have to click a link or button that triggered the topic to be published, then click the link to the topic after it had been created. I was trying to think of ways of reducing the complexity of the feature. Maybe an automatic redirect would not make things much more complex though.

Another thing to consider is that the user who triggers publishing the topic may or may not be logged into Discourse. Unless the WordPress site is the SSO provider for Discourse, I don’t think there’s a way to automatically authenticate the user, then redirect them to the new topic. The exception to this is if the topic is in a category that can’t be accessed by anonymous users. In that case, Discourse would automatically redirect an unauthenticated user to the login page, then back to the topic they were trying to access.

I don’t know. It might be worth following up on this:


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