# Error publishing topic with WP Discourse

**URL:** <https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270>\
**Category:** WordPress\
**Created:** [October 4, 2019, 7:10pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270 "2019-10-04T19:10:25Z")\
**Posts on this page:** 20\
**Page:** 1

## AI-generated summary

Users [pgross](/t/-/130270/1) and [spa](/t/-/130270/17) are experiencing "Forbidden" errors when trying to publish WordPress posts to Discourse via the WP Discourse plugin. [pgross](/t/-/130270/1) tried disabling Gutenberg, using Classic Editor, toggling autopublish/force publish, and deleting custom fields like `wpdc_topic_tags` and `wpdc_publishing_error` — but the error persisted. [simon](/t/-/130270/2) advised checking Connection Settings (using 'system' as Publishing Username and All Users API Key), verifying Discourse username matching, and ensuring the user has category permissions. [pgross](/t/-/130270/15) confirmed admin rights and tested with a fresh post — still Forbidden. [spa](/t/-/130270/17) reported the same issue on one of three identical multisite blogs, with no recent config changes — only difference being use of CoSchedule. [simon](/t/-/130270/18) suggested checking for protected categories, tags, or enabling "Add Featured Links" — [spa](/t/-/130270/19) confirmed using full content and that new posts work, but the specific failed post still fails. [simon](/t/-/130270/20) recommended Query Monitor for detailed error logging; [spa](/t/-/130270/21) found no Discourse error logs and suspects CoSchedule as the only variable, though no known conflicts exist. [simon](/t/-/130270/13) is working on improving error messaging for future clarity.

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 7:10pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/1 "2019-10-04T19:10:26Z")

</div>

Hi Simon,

I have a site ([mycp.org](http://mycp.org)) that has Wordpress as the master SSO. Everything is working well except for publishing to discourse. I had selected autopublish but I saw that this didn’t work with the block editor. I tried checking force publish and then updated the post. No joy. So I installed the classic editor (I’m not enamored with Gutenberg and all of its extra goo.) Tried to publish. No joy. Turned off force and auto and tried to publish an update from the editor (though I didn’t change anything this time). All along I’m getting this error: “There has been an error publishing your post. Please try again.”

Any thoughts on how to correct it or debug it?

Thanks,

paul

---

<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:** [October 4, 2019, 7:38pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/2 "2019-10-04T19:38:32Z")

</div>

> [@pgross](#):
>
> Any thoughts on how to correct it or debug it?

Are you getting the error with all posts, or just with a specific post?

If the problem is only happening for a specific post, go to the post’s edit screen and select ‘Custom Fields’ from the Screen Options tab that should be near the upper right of the page:

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/b/8b2c4df7ea724a79857085bb497eef5cd2a9f9ed.png)

Once you’ve done that, scroll down to and expand the Custom Fields meta box. If you see any fields that match the ones in this screenshot, you can safely click the ‘Delete’ button for them and try publishing the post to Discourse again. If you see a `wpdc_topic_tags` field, you can also delete that. It is possible that field is causing the issue (Discourse now returns an error for unallowed tags) - I’m implementing a fix for that right now.

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/e/9e729bec835b9c1bad52fd3374963f0153638804.png)

Let me know if this works, or if you’re still getting errors.

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 9:20pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/3 "2019-10-04T21:20:40Z")

</div>

Hey Simon,

It has been a while since I have tried with other posts so I can answer that first question. I did follow these instructions. There was one more field not show here, wpdc\_publishing\_error, which before and after this attempt (it didn’t work) has the value “Forbidden”.

I can try another post and update it if that would help.

Paul

---

<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:** [October 4, 2019, 9:27pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/4 "2019-10-04T21:27:02Z")

</div>

> [@pgross](#):
>
> There was one more field not show here, wpdc\_publishing\_error, which before and after this attempt (it didn’t work) has the value “Forbidden”.

That helps! Can you check the values that you’ve entered on the plugin’s Connection Settings tab? Make sure you are using your Discourse site’s All Users API Key and that the Publishing Username is set to ‘system’. The only case where this shouldn’t be set to ‘system’ is if you have edited the username of the System user on Discourse.

Next, go to your WordPress profile page and check that your Discourse Username exactly matches your username on Discourse. The Discourse Username field is found near the bottom of your WordPress profile page.

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 9:35pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/5 "2019-10-04T21:35:38Z")

</div>

My name on Wordpress is Paul\_Gross. My Discourse username is Paul\_Gross. I don’t see a user named “system” when I go to the Users page on Discourse and search for “system”.

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 9:37pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/6 "2019-10-04T21:37:37Z")

</div>

The site user contact name is “system”.

---

<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:** [October 4, 2019, 9:56pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/7 "2019-10-04T21:56:57Z")

</div>

If you go to your Admin / Users / Staff page, you should see a user with the name ‘system’ in the list. If you don’t see that user, it is possible that it was either deleted or renamed.

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 9:59pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/8 "2019-10-04T21:59:51Z")

</div>

It’s there. But right now I’m getting a “You are not connected to Discourse” on the [WP Discourse](https://github.com/discourse/wp-discourse) Connection page. Not sure why…

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 10:04pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/9 "2019-10-04T22:04:50Z")

</div>

Fixed that and still getting Forbidden…

---

<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:** [October 4, 2019, 10:08pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/10 "2019-10-04T22:08:24Z")

</div>

Does the user you are trying to publish the post under have the rights to publish topics in the Discourse category you are publishing the post to? The user who the post is published by is set by the Discourse Username you have set on your profile page.

Could you try publishing a fresh post to your site to see if the issue has something to do with this specific post?

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 10:11pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/11 "2019-10-04T22:11:22Z")

</div>

I would think the user, me, Paul\_Gross, admin and creator of the post on Wordpress has rights to publish under the category on Discourse that I defined (Research). I am the admin on both sides of this equation. Other reasons for being “forbidden”?

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 10:12pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/12 "2019-10-04T22:12:29Z")

</div>

BTW, thanks for your rapid fire dive on this. I have to leave my computer now so I will be able to answer from my phone but real digging requires me to have a big screen and a keyboard (my limitation – not Discourse responsive)!

Paul

---

<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:** [October 4, 2019, 10:15pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/13 "2019-10-04T22:15:54Z")

</div>

> [@pgross](#):
>
> BTW, thanks for your rapid fire dive on this.

It’s no problem. I’m working on a feature right now that will improve the error messages that get returned from Discourse. “Forbidden” on its own isn’t very helpful. When you get a chance, try publishing a fresh topic and let me know how that goes.

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 4, 2019, 10:18pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/14 "2019-10-04T22:18:12Z")

</div>

Great. W’ill do and will post back…

---

<div class="post-metadata">

**Author:** ![pgross](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pgross/32/157899_2.png) [@pgross](https://meta.discourse.org/u/pgross)\
**Post date:** [October 5, 2019, 11:34pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/15 "2019-10-05T23:34:16Z")

</div>

Hi Simon,

I’m not sure if this counts but I copied the content into a new post and posted it. Still got the Forbidden error code in the custom fields…

Paul

---

<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:** [October 16, 2019, 7:31pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/16 "2019-10-16T19:31:39Z")

</div>

Split this topic on October 16, 2019, 7:31pm UTC

9 posts were split to a new topic: [WP Discourse 1.9.5 bug](https://meta.discourse.org/t/wp-discourse-1-9-5-bug/131186)

---

<div class="post-metadata">

**Author:** ![spa](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@spa](https://meta.discourse.org/u/spa)\
**Post date:** [March 18, 2020, 7:20am UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/17 "2020-03-18T07:20:08Z")

</div>

We basically have 3 blogs on a multisite set up that post to the same Discourse forum. 2 of the 3 work fine with no issues, but one of them now returns a similar “Forbidden” error that @pgross mentioned earlier. I’ve tried the suggestions here with no luck. All the posts are posted by the same user and it worked fine for the last few months up until yesterday, so I’m a bit stumped here.

 ![Screenshot 2020-03-18 at 07.53.12](https://global.discourse-cdn.com/meta/original/3X/3/b/3bc3b813572b1912f2d418be0cbc17eb395f8403.png)

---

<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:** [March 18, 2020, 5:09pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/18 "2020-03-18T17:09:41Z")

</div>

> [@spa](#):
>
> 2 of the 3 work fine with no issues, but one of them now returns a similar “Forbidden” error

Can you find any difference between what is happening on the site that you are getting the Forbidden error on and the other sites? For example, are you publishing to a protected category on the site that is failing? Are you adding tags to topics that you are publishing to Discourse. If so, is there a chance that the tags are not allowed in the category that you are publishing to?

Do you have the [WP Discourse](https://github.com/discourse/wp-discourse) “Add Featured Links” option enabled? That option is found on the Publishing settings tab.

---

<div class="post-metadata">

**Author:** ![spa](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@spa](https://meta.discourse.org/u/spa)\
**Post date:** [March 19, 2020, 8:01am UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/19 "2020-03-19T08:01:20Z")

</div>

Hey @simon, all 3 blogs are essentially the same blog but in a different language. They’re all set up exactly the same, so as far as I can see, there are no differences. We haven’t been adding any tags. We do use the “Add Featured Links” option.

Hope that helps?

Edit: Just wanted to add, did a test with a new post, and it works fine, but the particular post that did not get pushed is still Forbidden.

---

<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:** [March 19, 2020, 4:43pm UTC](https://meta.discourse.org/t/error-publishing-topic-with-wp-discourse/130270/20 "2020-03-19T16:43:41Z")

</div>

> [@spa](#):
>
> did a test with a new post, and it works fine, but the particular post that did not get pushed is still Forbidden.

Could you try installing [Query Monitor – WordPress plugin | WordPress.org English (Canada)](https://en-ca.wordpress.org/plugins/query-monitor/), or a similar plugin, and then try publishing the post again? It should give you a detailed error message about the response that is received from Discourse.

Edit: are you publishing the full post content to Discourse, or are you just publishing excerpts of posts?

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