# Adding the wp-id parameter to topics created through WordPress

**URL:** <https://meta.discourse.org/t/adding-the-wp-id-parameter-to-topics-created-through-wordpress/64630>\
**Category:** Development\
**Tags:** wordpress\
**Created:** [16.Июнь.2017 18:30:25 UTC](https://meta.discourse.org/t/adding-the-wp-id-parameter-to-topics-created-through-wordpress/64630 "2017-06-16T18:30:25Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [20.Июнь.2017 14:41:27 UTC](https://meta.discourse.org/t/adding-the-wp-id-parameter-to-topics-created-through-wordpress/64630/4 "2017-06-20T14:41:27Z")

</div>

> [@blake](#):
>
> Are you not able to look up the topic\_id in the the wordpress post\_meta data?

I’m trying to match a list of updated Discourse topics to their corresponding WordPress posts. It’s being done at a regular interval in a cron job, so I’m trying to make it as efficient as possible. I’m especially concerned about multisite WordPress installations with an unknown number of subsites. In that case, it seems important to tie up as little time as possible in processing the cron job. On WordPress, finding a post by the value of a meta-key can be done, but it’s not efficient.

I only added the topic\_id as post metadata a couple of weeks ago. For posts created before that time, it’s not available. So on the WordPress end there’s no advantage of using the topic\_id metadata over using a new wp\_id that’s added as a property to Discourse topics.

If you do add it, the field doesn’t need to be `wp_id`. It could be something like `external_post_id` .

---

_[View the full topic](https://meta.discourse.org/t/adding-the-wp-id-parameter-to-topics-created-through-wordpress/64630)._
