# WP Discourse "Update Discourse topic" error

**URL:** https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656
**Category:** WordPress
**Created:** [29 mei 2018 om 13:24 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656 "2018-05-29T13:24:18Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [29 mei 2018 om 13:24 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/1 "2018-05-29T13:24:18Z")

</div>

Hi,

I am create blog post and linked existing topic. Discourse topic not updated, blog post url not seems on the topic.

Also, i tried “Update Discourse topic” on Wordpress panel. It gives me error:

`There has been an error publishing this post to Discourse.`

```
Reason for failure:
A 422 response code was returned from Discourse.
Unprocessable Entity

```

Any ideas?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [29 mei 2018 om 16:32 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/2 "2018-05-29T16:32:25Z")

</div>

> [@bekircem](#):
>
> I am create blog post and linked existing topic. Discourse topic not updated, blog post url not seems on the topic.

When you link a post to a Discourse topic, it does not update the topic until you select the ‘Update Discourse topic’ checkbox. Linked posts do not add the blog URL to the Discourse topic.

> [@bekircem](#):
>
> Also, i tried “Update Discourse topic” on Wordpress panel. It gives me error:
> 
> `There has been an error publishing this post to Discourse.`
> 
> ```plaintext
> Reason for failure:
> A 422 response code was returned from Discourse.
> Unprocessable Entity
> 
> ```

Can you try this with another post and see if you get the same error?

---

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [29 mei 2018 om 18:10 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/3 "2018-05-29T18:10:35Z")

</div>

I selected ‘Update Discourse topic’ checkbox. When i tried another post, it works.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [29 mei 2018 om 18:12 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/4 "2018-05-29T18:12:21Z")

</div>

Thanks for trying that! Can you give any details about the post that is returning the `422` error? Does the topic that it is linked to exist on your forum?

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [17 september 2018 om 20:44 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/5 "2018-09-17T20:44:15Z")

</div>

We are finding this problem right now, and I think I can contribute to this discussion. What happened in our case is:

1. An article is published in WordPress and a related topic is automatically created in Discourse.
2. However, for whatever reason (user post limit?), the new topic goes automatically to moderation.
3. The moderated topic is not public, The WP-Discourse plugin cannot “see it” and throws a first error message: `Reason for failure: A bad response was returned from Discourse. Check that: - your Discourse forum is online.`

If the moderator approves the post because everything is correct there, then…

When updating the article in WordPress in order to have a Discourse topic linked, the WP-Discourse plugin finds an article with an identical title / content, and this is what cause a second error message:

```plaintext
Reason for failure:
A 422 response code was returned from Discourse.
Unprocessable Entity

```

The solution is to delete the first Discourse topic and update the page again.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [17 september 2018 om 21:23 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/6 "2018-09-17T21:23:39Z")

</div>

Thanks for mentioning this. If a post that is published to Discourse gets added to the Needs Approval queue, the WordPress plugin should give some feedback about how to deal with it.

> [@icaria36](#):
>
> The solution is to delete the first Discourse topic and update the page again.

After the post has been approved you can also select the ‘Link to Existing Topic’ option from the post’s Discourse metabox. In the Topic URL field, enter the URL of the approved Discourse topic.

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [22 september 2018 om 14:30 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/8 "2018-09-22T14:30:04Z")

</div>

Yeah, I wonder why occasionally a post of these goes to moderation. It is sent by a trusted user. Maybe there is some kind of throttle? Several posts might be queued in WordPress, and then an administrator reviews them and might approve several of them pretty quickly.

> [@simon](#):
>
> After the post has been approved you can also select the ‘Link to Existing Topic’ option from the post’s Discourse metabox.

Not in our case because we have the “Force publish” option enabled. Therefore the metabox only says.

> The **force-publish** option has been enabled. All WordPress posts will be published to Discourse in the **Kaosenlared** category.

Once you know what is going on, it is not a big deal.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [19 oktober 2018 om 01:17 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/9 "2018-10-19T01:17:11Z")

</div>

> [@icaria36](#):
>
> We are finding this problem right now, and I think I can contribute to this discussion. What happened in our case is:
> 
> 1. An article is published in WordPress and a related topic is automatically created in Discourse.
> 2. However, for whatever reason (user post limit?), the new topic goes automatically to moderation.

When posts that are published from WordPress to Discourse get added to the Discourse approval queue, the user publishing the post should now see this message:

 ![01%20PM](https://global.discourse-cdn.com/meta/original/3X/f/2/f2c90f636d5ab054a6e42b7c1828a3b0cbec33c6.png)

When the topic is approved on Discourse and the Topic URL is updated on WordPress, they will see this:

 ![23%20PM](https://global.discourse-cdn.com/meta/original/3X/6/6/665883656d1e055b0d048dd2f84310133dcb780c.png)

Let me know if you are finding any posts that are added to the approval queue on Discourse but are not displaying this message on WordPress.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [29 januari 2019 om 10:45 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/10 "2019-01-29T10:45:45Z")

</div>

I have a similar issue in combination with a glossary plugin  
Whenever I try to create a new topic from the post or update it, I get the same error:

`A 422 response code was returned from Discourse. Unprocessable Entity`

Also my server’s CPU goes crazy and my DB cannot be reached for a minute or two.

Any way I can debug that?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [1 februari 2019 om 20:59 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/11 "2019-02-01T20:59:02Z")

</div>

> [@jrgong](#):
>
> I have a similar issue in combination with a glossary plugin  
> Whenever I try to create a new topic from the post or update it, I get the same error:

Are you able to publish any posts when the glossary plugin is enabled? What is the name of the plugin? Are you using the WordPress Block Editor, or the old Classic Editor?

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [2 februari 2019 om 04:34 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/12 "2019-02-02T04:34:23Z")

</div>

I am using the classic editor  
Plugin: [https://www.cminds.com/wordpress-plugins-library/tooltipglossary/](https://www.cminds.com/wordpress-plugins-library/tooltipglossary/)

> [@simon](#):
>
> Are you able to publish any posts when the glossary plugin is enabled?

Yes. As long as the` [glossary]` shortcode is not in the post, it works fine.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [5 februari 2019 om 02:10 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/13 "2019-02-05T02:10:24Z")

</div>

> [@jrgong](#):
>
> As long as the `[glossary]` shortcode is not in the post, it works fine.

> [@jrgong](#):
>
> Also my server’s CPU goes crazy and my DB cannot be reached for a minute or two.

How large is the glossary you were adding? I just tried the plugin with two items in the glossary and adding the shortcode to a post didn’t cause a problem.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [5 februari 2019 om 09:01 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/14 "2019-02-05T09:01:27Z")

</div>

> [@simon](#):
>
> How large is the glossary you were adding?

around 70 entries are in it

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [8 maart 2019 om 10:05 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/15 "2019-03-08T10:05:54Z")

</div>

Hey there

the issue reappeared again, this time I am not using the glossary shortcode at all.  
I tried to update this post: [https://www.cannabisanbauen.net/growbox-kaufberatung/](https://www.cannabisanbauen.net/growbox-kaufberatung/)

I need to update it since I enabled “use full post content”  
How can I debug the issue?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [8 maart 2019 om 17:41 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/16 "2019-03-08T17:41:25Z")

</div>

Are you getting the `A 422 response code was returned from Discourse. Unprocessable Entity` error when you try to update the post?

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [8 maart 2019 om 17:43 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/17 "2019-03-08T17:43:32Z")

</div>

yes, exactly. every time I try to update the discourse topic

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [8 maart 2019 om 17:50 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/18 "2019-03-08T17:50:50Z")

</div>

Could you try temporarily unchecking the ‘Use Full Post Content’ setting on WordPress and then updating the post again? If you don’t get any errors when you try that, then we’ll know that the problem is related to the content of the post. If you _do_ get errors, then the problem will be related to the post’s metadata.

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [9 maart 2019 om 02:17 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/19 "2019-03-09T02:17:03Z")

</div>

> [@simon](#):
>
> Could you try temporarily unchecking the ‘Use Full Post Content’ setting on WordPress and then updating the post again?

When unchecked, I am not getting any errors! So it’s content related…

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [9 maart 2019 om 02:43 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/20 "2019-03-09T02:43:42Z")

</div>

Is there anything in the content of that post that stands out as different from the content of posts that you have successfully published?

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [9 maart 2019 om 03:17 UTC](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656/21 "2019-03-09T03:17:12Z")

</div>

I think it might be shortcode related. I am using a plugin to display multiple product boxes via shortcodes called Affiliate Toolkit: [https://www.affiliate-toolkit.com/en/](https://www.affiliate-toolkit.com/en/)

I also observed a huge spike in CPU usage once I click the button to update the post.

I just tried a different article where only one simple formatting shortcode is used and it worked fine.

[Next page](https://meta.discourse.org/t/wp-discourse-update-discourse-topic-error/88656.md?page=2)
