# WordPress / Discourse API Strategy: Get Reply Count via API Efficiently

**URL:** <https://meta.discourse.org/t/wordpress-discourse-api-strategy-get-reply-count-via-api-efficiently/71943>\
**Category:** WordPress\
**Created:** [October 12, 2017, 4:52pm UTC](https://meta.discourse.org/t/wordpress-discourse-api-strategy-get-reply-count-via-api-efficiently/71943 "2017-10-12T16:52:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Berto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/berto/32/77084_2.png) [@Berto](https://meta.discourse.org/u/Berto)\
**Post date:** [October 12, 2017, 4:52pm UTC](https://meta.discourse.org/t/wordpress-discourse-api-strategy-get-reply-count-via-api-efficiently/71943/1 "2017-10-12T16:52:46Z")

</div>

Hi all,

I’m going to use a hybrid of WP-Discourse + [Embedded Comments via JS](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963) on our blog.

I’d like to **show the number of replies / comments each post has** , at least within the single post (`single.php`), but don’t want to slam the Discourse API 10,000+ times per day or slow the blog down while it retrieves that.

Does anyone have any good strategies for getting and saving the `reply_count` so that we don’t hit the server too often, or slow the blog from loading too often?

Are there good methods of “caching” the reply\_count in post\_meta / custom fields, and only updating it if it’s requested and the cache date is X hours old?

Or perhaps a cron job that just goes through _all_ posts and updates regularly without slowing down the site ever?

Any other ideas? This is more of a WordPress strategy than anything.

Thanks!!

---

_[View the full topic](https://meta.discourse.org/t/wordpress-discourse-api-strategy-get-reply-count-via-api-efficiently/71943)._
