# How to prevent some WP users from being able to login to Discourse

**URL:** <https://meta.discourse.org/t/how-to-prevent-some-wp-users-from-being-able-to-login-to-discourse/93234>\
**Category:** WordPress\
**Created:** [7월 26, 2018, 7:55오후 UTC](https://meta.discourse.org/t/how-to-prevent-some-wp-users-from-being-able-to-login-to-discourse/93234 "2018-07-26T19:55:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lkramer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lkramer/32/83897_2.png) [@lkramer](https://meta.discourse.org/u/lkramer)\
**Post date:** [7월 27, 2018, 3:30오후 UTC](https://meta.discourse.org/t/how-to-prevent-some-wp-users-from-being-able-to-login-to-discourse/93234/3 "2018-07-27T15:30:38Z")

</div>

Hi @simon. Thx! That action works in terms of preventing the user from logging in which is awesome! However, the wp-discourse plugin seems to still **automatically create the user** in Discourse (I think it happens upon them logging in). Is there a way to prevent that from happening? I see that there’s a action called _wpdc\_sso\_provider\_before\_create\_user_ which I tried using but no dice. I tried using it like so:

```
add_action( 'wpdc_sso_provider_before_create_user', 'wpdc_custom_before_create_user', 10, 2 );
function wpdc_custom_before_create_user( $user_login, $user ) {
	
	if ( ...my condition here... ) {
	    return(false);	
	}

}

```

(we don’t want to them to be a member of the forum at all because they’ll get the summary emails and so forth)

---

_[View the full topic](https://meta.discourse.org/t/how-to-prevent-some-wp-users-from-being-able-to-login-to-discourse/93234)._
