I’m experiencing an issue with the Discourse WordPress plugin when trying to publish a WordPress post to Discourse.
Issue Description:
When I create a new post on my WordPress site and check the “Publish to Discourse” option under the Discourse tab before publishing, the post successfully publishes to WordPress. However, the Discourse topic is not created at that time.
Later, if I edit the same post and go to the Discourse tab again, then click “New Topic” and publish to Discourse, the post does get created on the Discourse site. But this Discourse topic is not linked with the original WordPress post. There’s no permalink association or metadata saved back to the post.
Debug Findings:
While debugging, I noticed the call to:
/wp-json/wp-discourse/v1/publish-topic
returns the following response:
{
“publish_response”: “success”,
“permalink”: “”
}
As you can see, the “permalink” field is empty. This appears to be the core reason the Discourse topic is created but not linked back to the WordPress post (i.e., the permalink isn’t stored in the postmeta, so the link between WP and Discourse is broken).
Could you please help investigate why the permalink is returning empty in the API response? Is there a plugin misconfiguration or a bug in the publishing workflow?
Let me know if you need any logs or further information. Appreciate your help!