# Only allow access when user has a subscription plan on Memberpress

**URL:** <https://meta.discourse.org/t/only-allow-access-when-user-has-a-subscription-plan-on-memberpress/188716>\
**Category:** WordPress\
**Created:** [April 30, 2021, 3:39pm UTC](https://meta.discourse.org/t/only-allow-access-when-user-has-a-subscription-plan-on-memberpress/188716 "2021-04-30T15:39:32Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [April 30, 2021, 8:50pm UTC](https://meta.discourse.org/t/only-allow-access-when-user-has-a-subscription-plan-on-memberpress/188716/9 "2021-04-30T20:50:55Z")

</div>

It’s not as simple as just calling the `logout_from_discourse()` function, but it should be possible to use a WordPress action hook to call that function when a specific action is called on your WordPress site. For example, when a user’s membership level is revoked. Possibly someone in the Discourse community can help you with the syntax that is needed to make that work.

---

_[View the full topic](https://meta.discourse.org/t/only-allow-access-when-user-has-a-subscription-plan-on-memberpress/188716)._
