# A few questions about WP Discourse

**URL:** <https://meta.discourse.org/t/a-few-questions-about-wp-discourse/75752>\
**Category:** WordPress\
**Created:** [December 9, 2017, 9:54pm UTC](https://meta.discourse.org/t/a-few-questions-about-wp-discourse/75752 "2017-12-09T21:54:28Z")\
**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:** [December 9, 2017, 10:27pm UTC](https://meta.discourse.org/t/a-few-questions-about-wp-discourse/75752/2 "2017-12-09T22:27:16Z")

</div>

> [@hanks](#):
>
> is there any way to force WP users to login/create accounts through Discourse?

Yes, just don’t give them access to the WordPress login form. You should setup a way to give your site’s admins access to it, so that they don’t get locked out of WordPress if your forum it down, or SSO is misconfigured. You can add the Discourse login link to any WordPress page with the `[discourse_sso_client]` shortcode, or by creating a link with this form. Set the link’s `href` to the Home URL of your WordPress site, set the `redirect_to` value to the WordPress page you want users to end up on. You can also add a link like this to your Discourse forum.

```plaintext
<a href="http://example.com/?discourse_sso=1&redirect_to=http://example.com/welcome">Log in with Discourse</a>

```

> [@hanks](#):
>
> is it possible to use a WP plugin to allow users to log in through Facebook or other social media when being on the WP login form, and if they do this way it also creates a Discourse account?

Yes, this should work if you are using WordPress as the SSO provider for Discourse. I’ve tested it quite a bit with [wordpress.com](http://wordpress.com) as the authenticator for the WordPress site.

> [@hanks](#):
>
> - If the user is already logged in, show a text area which sends the content to Discourse through the API and redirects the user to the post discussion on Discourse
> - If the user isn’t logged in, show a login form which redirects somewhere after having logged in (on the WP post page or the post discussion on Discourse)

Yes, this can be done. It’s not a part of the plugin, because the idea behind the plugin is to improve commenting on WordPress pages. Discourse is designed to do this. Embedding a comment form would defeat that purpose for most cases.

The Discourse post\_id and topic\_id are saved as metadata on posts that are published to Discourse. You can use these values to publish to Discourse through the API.

---

_[View the full topic](https://meta.discourse.org/t/a-few-questions-about-wp-discourse/75752)._
