# Implement Log out button

**URL:** <https://meta.discourse.org/t/implement-log-out-button/122321>\
**Category:** Development\
**Created:** [July 8, 2019, 1:08pm UTC](https://meta.discourse.org/t/implement-log-out-button/122321 "2019-07-08T13:08:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 8, 2019, 5:06pm UTC](https://meta.discourse.org/t/implement-log-out-button/122321/2 "2019-07-08T17:06:20Z")

</div>

> [@Rahul\_Goswami](#):
>
> Login button will be in discourse, but logout option will be outside.

You can log users out through the Discourse API by making an authenticated `POST` request to `/admin/users/<user_id>/log_out`. You need to replace `<user_id>` with the user’s Discourse user ID.

You can see this implemented in the Discourse WordPress plugin here: [wp-discourse/lib/sso-provider/discourse-sso.php at main · discourse/wp-discourse · GitHub](https://github.com/discourse/wp-discourse/blob/master/lib/sso-provider/discourse-sso.php#L222)

---

_[View the full topic](https://meta.discourse.org/t/implement-log-out-button/122321)._
