# WP-Discourse \> 'Publish all new posts to Discourse.' \> not working

**URL:** <https://meta.discourse.org/t/wp-discourse-publish-all-new-posts-to-discourse-not-working/58250>\
**Category:** WordPress\
**Created:** [2017 年 3 月 2 日午後 7:48 UTC](https://meta.discourse.org/t/wp-discourse-publish-all-new-posts-to-discourse-not-working/58250 "2017-03-02T19:48:28Z")\
**Posts on this page:** 1\
**Showing post:** 20

<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:** [2018 年 1 月 8 日午前 3:05 UTC](https://meta.discourse.org/t/wp-discourse-publish-all-new-posts-to-discourse-not-working/58250/20 "2018-01-08T03:05:24Z")

</div>

To hardcode it you would add:

```plaintext
update_post_meta( $post_id, 'publish_post_category', $your_discourse_category_id );

```

WIth `$your_discourse_category_id` set to the Discourse category\_id that you wish to publish to. But you shouldn’t have to do that. It should publish automatically to the default category that you have set on the Publishing tab. I’ll look at this some more.

Probably the easiest way to find the Discourse category\_id is to go to `your.forum.com/site.json` and search for the `categories` array.

---

_[View the full topic](https://meta.discourse.org/t/wp-discourse-publish-all-new-posts-to-discourse-not-working/58250)._
