# 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:** 8

<div class="post-metadata">

**Author:** ![Per\_Jacobsson1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/per_jacobsson1/32/202417_2.png) [@Per\_Jacobsson1](https://meta.discourse.org/u/Per_Jacobsson1)\
**Post date:** [April 30, 2021, 8:38pm UTC](https://meta.discourse.org/t/only-allow-access-when-user-has-a-subscription-plan-on-memberpress/188716/8 "2021-04-30T20:38:01Z")

</div>

Can I just call the function logout\_from\_discourse() or do I have to copy all that code?

---

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