# Configureer single sign-on (SSO) met WP Discourse en DiscourseConnect

**URL:** https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494
**Category:** Administrators
**Tags:** sso, wordpress, video, discourseconnect, how-to
**Created:** [6 april 2022 om 13:15 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494 "2022-04-06T13:15:15Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [6 april 2022 om 13:15 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/1 "2022-04-06T13:15:15Z")

</div>

The [WP Discourse](https://github.com/discourse/wp-discourse) plugin lets you set up [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) in Wordpress so your users can use their Wordpress account to log into Discourse, or their Discourse account to log into Wordpress. Before you can set up [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) you first have to install the [WP Discourse](https://github.com/discourse/wp-discourse) plugin on Wordpress and Connect it to your Discourse. If you’re ready to get started, start by watching this short video, or follow the instructions below.

https://www.loom.com/embed/9ae65a956a4d49a283798e3f441ec558

## Next Step

Once you’ve set up [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true), you may want to check out the following topics

- [Publishing Wordpress Posts to Discourse](https://meta.discourse.org/t/wp-discourse-and-publishing-posts-to-discourse/223492/1)
- [Using Discourse for Wordpress Comments](https://meta.discourse.org/t/wp-discourse-and-commenting/223493/1)

* * *

## Instructions

### Setting a Secret Key

Whether you’re setting up [WP Discourse](https://github.com/discourse/wp-discourse) as the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Provider or Client, you need to set a secret key. Go to the “[DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Secret Key” tab and enter a string of text (numbers, letters, and symbols are all allowed), at least 10 characters long. Use the same rules for creating this as you would to create a strong password. Make sure you save it when you’re done.

Then, open your Discourse Site Settings (in the Admin panel), and search for “[discourse connect](https://meta.discourse.org/t/13045?silent=true)”. One of the settings near the top will be `discourse connect secret`. Paste the secret key you set in [WP Discourse](https://github.com/discourse/wp-discourse) in there and click the green tick.

### Logging into Discourse with Wordpress ([DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Provider)

> Make sure you’re [WP Discourse](https://github.com/discourse/wp-discourse) is connected to your Discourse and your secret key is set ( ☝ ) before following these instructions

To let your users log into Discourse using their Wordpress account details, you need to setup [WP Discourse](https://github.com/discourse/wp-discourse) as the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Provider. Go to the `DiscourseConnect Provider` tab in the [WP Discourse](https://github.com/discourse/wp-discourse) settings, select the `Enable DiscourseConnect Provider` checkbox and save your settings.

Next, go to your Discourse Site Settings and enter “[discourse connect](https://meta.discourse.org/t/13045?silent=true)” into the search box to see all your Discourse [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) settings. First, set the `discourse connect url` to the URL of our Wordpress. The final step is to select `enable discourse connect`. Make sure you’re ready to go before you select this as once you do, your users will only be able to log in to Discourse using Wordpress.

Once you’ve enabled [discourse connect](https://meta.discourse.org/t/13045?silent=true) in Discourse, to make sure that it is setup correctly open an incognito window in your browser. Keep your normal (non-incognito) browser window logged in to an admin account (just in case something goes wrong and you need to change the settings back). In the incognito window you’ll notice that the Discourse ‘Sign Up’ button no longer appears. Click on the ‘Log In’ button. You should see a Wordpress login screen. Enter your Wordpress credentials to log in. You should then be redirected back to Discourse and be logged in.

If something goes wrong, or you notice something is not quite right, go back to your normal browser window and disable `enable discourse connect` to let your users log into Discourse normally. If you’re no longer logged in to your admin account in your normal browser window for some reason, check out the “Disable [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Through the Discourse Console” section in Troubleshooting below to regain access to your Discourse.

#### Email Verification

Discourse expects all user’s email addresses to be verified and WordPress doesn’t force users to verify their email address. In a default WordPress setup it is fairly easy to verify a user’s email address during the registration process, but if a site is using a plugin that creates a front end registration form - for example, the registration form that can be added with WooCommerce - the [WP Discourse](https://github.com/discourse/wp-discourse) plugin isn’t able to verify the user’s email.

In users’ emails aren’t being verified in Wordpress, before a WordPress user will be able to login to the forum, they will need to respond to an email verification notice that is sent out by Discourse. The plugin has a couple of filters that can be used to override this behaviour. Take a look at the code, starting [here](https://github.com/discourse/wp-discourse/blob/master/lib/sso-provider/discourse-sso.php#L277), for details.

#### Remove the `require_activation` flag

If you’re sure that WordPress is authenticating email addresses, you can tell Discourse that it doesn’t need to. To completely remove the require\_activation flag, add something like this to your Wordpress (e.g. in your theme’s `functions.php` file):

```php
// Replace 'my_prefix' with your site prefix.

add_filter( 'discourse_email_verification', 'my_prefix_discourse_email_verification' );
function my_prefix_discourse_email_verification( $require_activation ) {
    return false;
}

```

To remove the require\_activation flag for specific users, use something like this:

```php
// Replace 'my_prefix' with your site prefix.

add_filter( 'discourse_email_verification', 'my_prefix_discourse_email_verification', 10, 2 );
function my_prefix_discourse_email_verification( $require_activation, $user_id ) {
    $user = get_userdata( $user_id );
    if ( /* some condition tested against $user */ ) {

        return true;
    }

    return false;
}

```

#### Userdata Webhook

> This Webhook exists for historical reasons - having the Discourse Name field automatically filled in can now be accomplished by using the `Create or Sync Discourse Users on Login` [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Provider option.

The `Update Userdata` webhook (in the “Webhooks” settings panel) can be used when WordPress is the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Provider for your Discourse. The webhook automatically fills in the user’s Discourse Name field on WordPress.

#### Creating an [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Login Link

If you have the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Provider option enabled, you can add a [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) login link to your WordPress site by creating a link with the following structure:

```html
<a href="https://discourse.example.com/session/sso?return_path=/">Community</a>

```

Set the value of `return_path` to the page on your forum you would like the user to end up on. You can add an SSO login link to a WordPress menu by adding a URL with this structure as a Custom Link in the Menus section of the WordPress dashboard.

### Logging in to WordPress with Discourse ([DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Client)

To enable your site to function as an [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Client for Discourse, click on the `DiscourseConnect Client` tab. On that page, select the `Enable DiscourseConnect Client` and `Add Login Link` options.

Now go to your Discourse Admin / Settings page and search for ‘[discourse connect](https://meta.discourse.org/t/13045?silent=true)’ to see all your [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) options.

- select the ‘enable [discourse connect](https://meta.discourse.org/t/13045?silent=true) provider’ setting
- copy your `DiscourseConnect Secret Key` from WordPress to the ‘secret’ field of the Discourse ‘[discourse connect](https://meta.discourse.org/t/13045?silent=true) provider secrets’ setting. In that setting’s ‘domain’ field enter your WordPress site’s domain. Then click the green checkmark to save your settings.

When complete, the ‘[discourse connect](https://meta.discourse.org/t/13045?silent=true) provider secrets’ setting on Discourse should look like this (with the domain set to your WordPress domain):

 ![](https://global.discourse-cdn.com/meta/original/3X/8/2/82659d0e798ad365af992d79e897a33aa8a5eda0.png)

Discourse should now be functioning as a [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider for your WordPress site.

Open your Wordpress site in an incognito window in your browser. When you now go to your login page, you should see a ‘Log in with Discourse’ link underneath the login form. Click it and you’ll be taken to the Discourse login form. Login there, and you’ll be redirected back to the WordPress login page with a notice saying that you need to sync your account with Discourse. Follow the instructions in the notice to link your accounts, and you should now be able to log into your WordPress site through Discourse.

**Note** : this behaviour only affects users who have existing accounts on both WordPress and Discourse. New WordPress accounts that are created through Discourse [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) will be able to login freely to WordPress the first time the click the ‘Log in with Discourse’ link. To make it easier for users with existing accounts on both your WordPress site and your Discourse forum to login through Discourse, select the `Sync Existing Users by Email` checkbox on the `DiscourseConnect Client` options tab.

### Syncing Discourse Logout

When [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) is enabled, logout from Discourse can be synced with your WordPress site by adding your site’s `home_url` with the query parameter `request=logout` to the Discourse Site Setting `logout redirect`. The setting is in the Discourse settings section at `/admin/site_settings/category/users`. Here’s an example ‘logout redirect’ URL:

```plaintext
http://example.com/?request=logout

```

### Troubleshooting

If you’re having issues with using WordPress as the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider for your forum, the first things to check are:

- that the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Secret keys set on WordPress and Discourse are the same
- make sure that you have selected `Enable DiscourseConnect Provider` on your WordPress site
- make sure you have entered the correct `discourse connect url` on Discourse.

#### “Login Error” when using [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true)

If users are getting a “Login Error” message when they attempt to login to Discourse, please see

[Debug and fixing common DiscourseConnect issues](https://meta.discourse.org/t/debugging-and-fixing-common-discourseconnect-issues/103496).

#### Disabling [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true)

If [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) isn’t working for you, you can turn it off by disabling the `enable discourse connect` site setting. If you’re not still logged into an admin account somewhere to turn it off, don’t worry, there’s a few ways you can get back in to turn it off.

##### Login via /users/admin-login

Open a new browser window and enter your forum URL in the URL bar followed by `/users/admin-login`, e.g.

```plaintext
https://community.mysite.com/users/admin-login

```

You should see an input asking you for your admin email. After you submit your email, you’ll receive an email with a link that will allow you to log-in directly to your admin account. You can then go to your site settings and disable `enable discourse connect` to turn [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) off.

If this doesn’t work for some reason, don’t worry, you can still turn [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) off via your server’s console (👇)

##### Turn off [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) through the server console

If you don’t know what the server console is, or you don’t have access to it, reach out to your hosting provider for help. After you’ve SSH’d into your server, the commands you need to run are as follows:

```plaintext
cd /var/discourse
./launcher enter app
rails c
SiteSetting.enable_discourse_connect=false
exit
exit

```

---

<div class="post-metadata">

### Author: ![LosHunterros](https://avatars.discourse-cdn.com/v4/letter/l/c6cbf5/32.png) [@LosHunterros](https://meta.discourse.org/u/LosHunterros)
#### Post date: [7 mei 2024 om 18:36 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/2 "2024-05-07T18:36:47Z")

</div>

What if i don’t have those options in my Discourse? 😕

 ![obraz_2024-05-07_203637343](https://global.discourse-cdn.com/meta/original/4X/3/7/2/3728a0bff3bcb0b1043d39a98f3f4297868aba3e.png)

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [7 mei 2024 om 18:47 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/4 "2024-05-07T18:47:28Z")

</div>

Hey @LosHunterros, welcome to Meta!

[Discourse Connect](https://meta.discourse.org/t/13045?silent=true) is not included in the basic hosting plan  
[![Screenshot_20240507_204846_Chrome](https://global.discourse-cdn.com/meta/original/4X/5/f/3/5f3ade18ec770ce3f9cf05c06a3c2d245d217a04.jpeg)](https://discourse.org/pricing)

---

<div class="post-metadata">

### Author: ![LosHunterros](https://avatars.discourse-cdn.com/v4/letter/l/c6cbf5/32.png) [@LosHunterros](https://meta.discourse.org/u/LosHunterros)
#### Post date: [7 mei 2024 om 18:51 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/5 "2024-05-07T18:51:06Z")

</div>

Thanks for your response

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [6 december 2024 om 22:09 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/6 "2024-12-06T22:09:25Z")

</div>

Now I need really 101 level. Or simple yes or no.

I need easy access from WordPress to my forum for those customers. Because they have created an account in WordPress I would use it as a provider.

But I have problems with AI of Discourse now. I’ve understood that [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) will hijack all other logins, as Google, Microsoft and local. But AI is really strongly sure that is not true, if I set `discourse connect allowed redirect domains`.

Well, I did. And still redirecting to Wordpress happens without any other login options.

So, did I waste two hours of my life because of hallucination of an AI, or have I done something wrong? Because if I was right in the beginning and [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) doesn’t allow other logins, I take it off rightaway. Living without Google login isn’t an option in this corner of Europe.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [7 december 2024 om 13:44 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/7 "2024-12-07T13:44:49Z")

</div>

Your initial thought was right. The AI is wrong: [See further](https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045).

> [@Setup DiscourseConnect - Official Single-Sign-On for Discourse (sso)](https://meta.discourse.org/t/setup-discourseconnect-official-single-sign-on-for-discourse-sso/13045/1):
>
> ### What if I would like SSO in conjunction with existing auth?
> 
> The intention around [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) is to replace Discourse authentication, if you would like to add a new provider see existing plugins such as: [Discourse VK Authentication (vkontakte)](https://meta.discourse.org/t/vk-com-login-vkontakte/12987)

> [@Jagster](#):
>
> So, did I waste two hours of my life because of hallucination of an AI

Unfortunately, yes.

---

<div class="post-metadata">

### Author: ![MikeP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikep/32/530282_2.png) [@MikeP](https://meta.discourse.org/u/MikeP)
#### Post date: [19 november 2025 om 12:33 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/9 "2025-11-19T12:33:52Z")

</div>

I’ve followed the setup guide to the point where SSO should be working. When I visit my Discourse site in an incognito window, I’m immediately redirected to my WordPress front page with a long query string in the URL and no visible login options.

Is this the expected behaviour at this stage?  
Do I now just need to finish building the WordPress side (login/register etc.), or have I misconfigured something?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [19 november 2025 om 14:09 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/10 "2025-11-19T14:09:40Z")

</div>

Hey Mike, welcome. You should be directed to the standard Wordpress login page. The first thing that comes to mind is that your theme (or a plugin) is providing a custom login page. What does your login page normally look like?

---

<div class="post-metadata">

### Author: ![MikeP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikep/32/530282_2.png) [@MikeP](https://meta.discourse.org/u/MikeP)
#### Post date: [19 november 2025 om 15:14 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/11 "2025-11-19T15:14:39Z")

</div>

Hey Angus, thanks! 🙂

This is a fresh install of both WordPress and Discourse, with the Twenty Twenty-Five theme active. I followed your video instructions step by step, but when I hit Discourse in an incognito window it redirects to the WordPress site and lands on the theme’s home page, not a login screen.

The WordPress site is currently behind directory privacy as it’s on a dev environment – could that be affecting the redirect to the normal login page?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [20 november 2025 om 10:33 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/12 "2025-11-20T10:33:53Z")

</div>

Hey Mike, here’s a little video of me I just recorded showing a working installation on the current code.

https://www.loom.com/embed/c5a2d019338f432ebfef0a50dcbe77aa

Just check your setup against what I show in the video and if you’re sure you’ve got it set up the same and it’s still not working, we’ll go through a process of elimination to see if we can pin down why.

---

<div class="post-metadata">

### Author: ![MikeP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikep/32/530282_2.png) [@MikeP](https://meta.discourse.org/u/MikeP)
#### Post date: [20 november 2025 om 11:28 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/13 "2025-11-20T11:28:32Z")

</div>

Hi Angus,

Thanks a lot for making that video, awesome support!

I’ve provided screenshots of each section (with sensitive information blurred)

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/2/3/e232230b3a5f0992b016ee0a0d483b1f98d1ad60.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/9/7/39770e422068f50a20447b0270d9c788c11750b3.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/3/7/d37a3ed8f410bed409259acf51535ceef6fd49ee.png)

On the above one, this wasn’t actually selected (whoops) but, when I visit the forum on an incognito browser, it now automatically redirects to /wp-login.php - I’m not shown the forum and login button like you are.

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/b/8/2b88ce7f119fefd76e75c2e99120c403ddc231bb.png)

I’m not overly fussed that it goes straight to the wp-login page now but having direct view access to the forum is always a bonus!

---

<div class="post-metadata">

### Author: ![MikeP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikep/32/530282_2.png) [@MikeP](https://meta.discourse.org/u/MikeP)
#### Post date: [20 november 2025 om 15:52 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/14 "2025-11-20T15:52:22Z")

</div>

@angus I figured it out… During the initial “what am I doing”, I locked the community with this;

![image](https://global.discourse-cdn.com/meta/original/4X/5/e/5/5e5b565f025d40e17589d305159ed31b5d261e4f.png)

Apologies for being a PITA, in startup mode 💨 .

Thanks again for the awesome support - I’m sure I’ll be back.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [20 november 2025 om 16:12 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/15 "2025-11-20T16:12:40Z")

</div>

Glad you figured it out!

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [22 november 2025 om 08:22 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/16 "2025-11-22T08:22:13Z")

</div>

Hi Angus I wonder if you can help with this issue I am having, not had any response to my topic:

> [@Anonymising a user with SSO, keeps being recreated](https://meta.discourse.org/t/anonymising-a-user-with-sso-keeps-being-recreated/383274):
>
> I am using SSO from WordPress to Discourse. If I anonymise a user, with the intention of removing the name and picture against all their posts (the user is banned), then if that user logs in again in WordPress it allows them to create a brand new account in Discourse based on their profile, which essentially unbans them as a new account. This is a problem. Is there a way to mark some people in the system as “Do not let them create a new account with this same email address” or something?

Basically if I anonymise a user then the SSO plugin just creates them a new account. Is there a way to disable users individually to stop it creating new accounts for them, and can it sync automatically when I ban or anonymise someone?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [22 november 2025 om 12:35 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/17 "2025-11-22T12:35:41Z")

</div>

> [@Shauny](#):
>
> Basically if I anonymise a user then the SSO plugin just creates them a new account

Maybe anonymise the user and then make their email address be the SSO one. Or have WordPress disallow the user (this seems like the real solution–WordPress should deny the user)

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [23 november 2025 om 12:07 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/18 "2025-11-23T12:07:40Z")

</div>

How do I have WordPress disallow the user from logging in via SSO? That’s the solution I think.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [23 november 2025 om 14:04 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/19 "2025-11-23T14:04:09Z")

</div>

That’s a wordpress question. 😉

I used the internet and it looks like you can change their role to “no role on this site”

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [23 november 2025 om 14:43 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/20 "2025-11-23T14:43:07Z")

</div>

Ah know what I meant was, I want the user to be able to carry on using the website but not be able to create a forum account.

Our forum is separate to the website so some people who are banned from the community for being disruptive should still be able to use the website which is a SaaS tool.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [23 november 2025 om 14:52 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/21 "2025-11-23T14:52:49Z")

</div>

Then I think you’ll need to suspend them in discourse. If you need to anonymize their content then you’ll need to do that and then create a the account that is suspended.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [24 november 2025 om 11:46 UTC](https://meta.discourse.org/t/configure-single-sign-on-sso-with-wp-discourse-and-discourseconnect/223494/22 "2025-11-24T11:46:16Z")

</div>

Hey @Shauny I have responded to your original support post:

> [@Anonymising a user with SSO, keeps being recreated](https://meta.discourse.org/t/anonymising-a-user-with-sso-keeps-being-recreated/383274/2):
>
> Hey @Shauny sorry for missing this. We have a dedicated #Support > WordPress category which is watched closely for Wordpress issues. What I would suggest here is the approach detailed in this post. Let me know how you go with that.
