# Post Not Properly Published to Discourse – Missing Permalink in API Response

**URL:** https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788
**Category:** WordPress
**Created:** [April 21, 2025, 9:35am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788 "2025-04-21T09:35:56Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![techops](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@techops](https://meta.discourse.org/u/techops)
#### Post date: [April 21, 2025, 9:35am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/1 "2025-04-21T09:35:56Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 21, 2025, 7:34pm UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/3 "2025-04-21T19:34:51Z")

</div>

Hello @techops, could you please share any relevant logs from [WP Discourse](https://github.com/discourse/wp-discourse) \> Logs in Wordpress. Please also share the meta file from that view if possible.

---

<div class="post-metadata">

### Author: ![techops](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@techops](https://meta.discourse.org/u/techops)
#### Post date: [April 22, 2025, 5:02am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/4 "2025-04-22T05:02:56Z")

</div>

Hi Angus,

Thanks for the quick response.

There are **no logs** available under **[WP Discourse](https://github.com/discourse/wp-discourse) \> Logs** in the WordPress dashboard, the log view is currently empty.

However, here is the meta file you requested: [Discourse meta - Google Docs](https://docs.google.com/document/d/1g-u-iNTPugPQ3a0z9aKF0fJCk_h7_-mZdbLZk5s2glo/edit?usp=sharing)

Please let me know if there’s anything else I can provide to help troubleshoot this issue.

Thanks!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 22, 2025, 6:43am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/5 "2025-04-22T06:43:33Z")

</div>

Thanks @techops, there’s a few things I’d like to to do.

Please disable this setting in the Publishing settings

> Send Email Notification on Publish Failure

Please make sure this setting is enabled in Publishing settings

> Verbose Publication Logs

You have a number of post types set up for publication

> post,event,groups,collections,podcast

Which post type are you experiencing this issue with? If it’s not `post` could you explain a bit more about how that post type is set up?

---

<div class="post-metadata">

### Author: ![techops](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@techops](https://meta.discourse.org/u/techops)
#### Post date: [April 22, 2025, 4:02pm UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/6 "2025-04-22T16:02:45Z")

</div>

Hi Angus,  
I’ve applied the suggested settings:

- **Disabled** : _Send Email Notification on Publish Failure_
- **Enabled** : _Verbose Publication Logs_

I’m using the **post** post type only.

After updating the settings, I created and published a new post to Discourse. Here are the logs generated:

```plaintext
[2025-04-22 15:58:12] publish.INFO: create_post.post_success {"wp_title":"test post 4","wp_author_id":"221","wp_post_id":15068} 
[2025-04-22 15:58:12] publish.INFO: create_post.body_valid {"wp_title":"test post 4","wp_author_id":"221","wp_post_id":15068} 
[2025-04-22 15:58:12] publish.INFO: create_post.after_publish {"post_id":15068,"remote_post_type":"create_post","discourse_post_id":"","discourse_topic_id":"6910","discourse_permalink":""} 

```

Let me know if you need any additional information or details.

Thanks!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 23, 2025, 5:16am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/7 "2025-04-23T05:16:35Z")

</div>

Thanks for sharing that. Those logs look normal to me. I can see that a Discourse topic is being created after a Wordpress post is published. Could you confirm exactly what the issue is? Please describe it in these terms:

1. I compose a post in Wordpress.
2. After the post is published I expect to see…

Try not to make any technical assumptions at this stage. Thanks!

---

<div class="post-metadata">

### Author: ![techops](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@techops](https://meta.discourse.org/u/techops)
#### Post date: [April 23, 2025, 6:58am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/8 "2025-04-23T06:58:36Z")

</div>

Hi Angus,  
I composed a post in WordPress.  
After the post is published, I expect to see the following behavior:

When the checkbox under **‘Publish to Discourse’** is checked, the correct behavior is that a post is created in Discourse, and it should be linked with the post in WordPress.

However, what actually happens is that the post is created in Discourse, but the link is immediately lost. It then has to be manually recreated.

Thanks!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 23, 2025, 7:50am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/9 "2025-04-23T07:50:28Z")

</div>

Thanks, can you also confirm the following:

1. Which Wordpress post composer are you using? Classic or Gutenberg? Are these posts being created in an non-standard way (e.g. I see you’re using “Gravity Forms Advanced Post Creation”)
2. Can you share an example Wordpress post and Discourse topic where this issue is occuring?
3. Are you using any plugin that modifies Wordpress meta fields (e.g. Advanced Custom Fields)?

---

<div class="post-metadata">

### Author: ![techops](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@techops](https://meta.discourse.org/u/techops)
#### Post date: [April 23, 2025, 8:22am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/10 "2025-04-23T08:22:31Z")

</div>

Thanks for following up. Here are the details:

- We are using the **Gutenberg** editor for creating posts.
- We are **not using any custom field plugins** such as Advanced Custom Fields.
- I’ve recorded a video replicating the issue for your review. You can check it [here](https://www.awesomescreenshot.com/video/39046107?key=19becf5a26c0afe8d6b231989112cc55).

Let me know if you need any additional information or further testing.  
If it helps, I can also provide **temporary login access** so you can explore the setup directly.

Thanks!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 23, 2025, 8:33am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/11 "2025-04-23T08:33:17Z")

</div>

Thanks for recording the video. It seems you’re using a custom publication workflow to publish posts.

 ![Screenshot at Apr 23 10-30-34](https://global.discourse-cdn.com/meta/original/4X/9/3/0/9300f54b3e09366854fd9ff2605efbaba9a87f21.jpeg)

This may be connected to the issue.

Are you able to try publishing posts without this custom workflow? The way we will get to the bottom of this is a process of elimination. It is likely that one of your customisations is not interoperable with the [WP Discourse](https://github.com/discourse/wp-discourse) publish feature set.

---

<div class="post-metadata">

### Author: ![techops](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@techops](https://meta.discourse.org/u/techops)
#### Post date: [April 23, 2025, 9:14am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/12 "2025-04-23T09:14:22Z")

</div>

Thanks for the suggestion.  
I’ve tested publishing posts directly without using the custom workflow, but unfortunately, it still doesn’t work.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 23, 2025, 10:52am UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/13 "2025-04-23T10:52:18Z")

</div>

Ok, please keep going in that vein. One of your customisations is likely preventing the [WP Discourse](https://github.com/discourse/wp-discourse) plugin from saving the post\_id and the permalink when a topic is published.

---

<div class="post-metadata">

### Author: ![techops](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@techops](https://meta.discourse.org/u/techops)
#### Post date: [April 23, 2025, 1:42pm UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/14 "2025-04-23T13:42:44Z")

</div>

Thanks, Angus.

I’ve identified the culprit, the SmartCrawl SEO plugin is conflicting with [WP Discourse](https://github.com/discourse/wp-discourse). After deactivating SmartCrawl, the posts are publishing to Discourse as expected and linking correctly to the WordPress posts.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 23, 2025, 3:14pm UTC](https://meta.discourse.org/t/post-not-properly-published-to-discourse-missing-permalink-in-api-response/362788/15 "2025-04-23T15:14:54Z")

</div>

Well done on finding the culprit. I think at this point it might be worth running this by their support team, i.e. “Your plugin seems to be stopping another plugin from using standard wordpress apis…” and then describe the issue. You can point them to this topic perhaps.
