# WP Discourse comment webhook does not trigger a WP Rocket Cache refresh

**URL:** https://meta.discourse.org/t/wp-discourse-comment-webhook-does-not-trigger-a-wp-rocket-cache-refresh/236700
**Category:** WordPress
**Tags:** wordpress
**Created:** [August 20, 2022, 12:01pm UTC](https://meta.discourse.org/t/wp-discourse-comment-webhook-does-not-trigger-a-wp-rocket-cache-refresh/236700 "2022-08-20T12:01:21Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![Brandon007](https://avatars.discourse-cdn.com/v4/letter/b/b4bc9f/32.png) [@Brandon007](https://meta.discourse.org/u/Brandon007)
#### Post date: [December 18, 2022, 9:14pm UTC](https://meta.discourse.org/t/wp-discourse-comment-webhook-does-not-trigger-a-wp-rocket-cache-refresh/236700/13 "2022-12-18T21:14:12Z")

</div>

I forgot to mention, your update did fix the issue! Thank you. 👍🏼

For anyone else running into this issue while running WP-Rocket with WP-Discourse. The following code _(insert in your Wordpress function file)_ will ensure once a comment is made on the corresponding Discourse post, it will purge the cache for that post.

```plaintext
if( function_exists( 'rocket_clean_post' ) ){
	add_action( 'wpdc_after_webhook_post_update', 'bulk_rocket_clean_post’);
}

function bulk_rocket_clean_post(array $ids){
    foreach ($ids as $id) {
        rocket_clean_post($id);
    }
}

```

---

_[View the full topic](https://meta.discourse.org/t/wp-discourse-comment-webhook-does-not-trigger-a-wp-rocket-cache-refresh/236700)._
