SSO: Unable to logout

Thank you, Simon. It’s a single WP site and a cookie would seem plausible. I’ll dig into that front, then.

Appreciate the advice!

brian driggs //// tgp

If you have a development site, try disabling all plugins except WP Discourse and see if the problem persists. If you don’t have a dev site, you could try deactivating plugins for your user’s session with the Health Check plugin. Details about how to use that plugin to disable plugins for a session are given here: Troubleshooting using the Health Check – Make WordPress Support.


Boom. Don’t have a dev site, but the health check plugin worked a treat—first try, even. Looks like I’ll be digging into MemberPress and the auth_cookie. Thank you, Simon.

Here’s the steps I took, should someone else need them:

  1. Installed the Health Check plugin.
    – Put site in Troubleshooting mode.
    – Enabled WP-Discourse plugin.
  2. Opened Discourse site.
    – Logged out.
    – Got redirected to WP login page (login form was missing).
    – Was unable to log back into Discourse at all. (Desired functionality.)
  3. Enabled MemberPress
    – (I realized the login page uses MemberPress-generated un/pw fields.)
    – Login form re-appeared.
  4. Opened Discourse site, was already logged in.
  5. Attempted logout, was redirected through a loop back to Discourse, still logged in.

I’ve been using WP since 2007 and had never heard of this plugin until now. Thanks again, Simon!

1 Like

Yeah, it’s very useful for troubleshooting.

I’d like to check what’s going on with MemberPress, but it’s a paid plugin. From looking at their documentation, it seems that there is a MemberPress Logout Redirect URL that can be set on the plugin’s options page. The issue might be related to that setting.


How can I help?

I noticed the logout redirect setting and set some targets, but it doesn’t appear to have any effect.

I’m trying to work out a way to logout Discourse from an external site. I’ve tried to find documentation and it seems the way to do it is sending an API POST request as mentioned in this post.

Problem is I don’t really understand how to make the API request and can’t work out where to go from here. I’ve downloaded Postman and trying to experiment in there, but I’m struggling. I’m not sure how to create the api request I need, and not sure how I’d implement it on the external site afterwards.

Any suggestions on how to crack this issue?

If you can give some details about your external site, someone here may be able to help.

1 Like

The site is a Wordpress site using Memberpress and it’s the SSO provider to my Discourse forum. After they logout on Wordpress I can redirect them to a URL, which I’d like to be the way I log them out of Discourse at the same time. Or perhaps I can send an api request via a php function which I could add to functions.php?

Are you using the WP Discourse plugin for SSO? If so, logging out from WordPress should log you out of Discourse, but there is a recent report that this is not working when the Memberpress plugin is used on WordPress: SSO: Unable to logout. Are you running into the same issue?

1 Like

Yes I’m using that plugin and it seems to be the same issue.


Great! I’ll try to get that fixed tomorrow.


Because you’re the man. Thanks, Simon. :slight_smile:

1 Like

That would be so helpful! If you need any further info from me, just let me know. Thanks!

1 Like

I’m having some trouble reproducing the issue. If I could create an account on either of your WordPress sites I might be able to see what’s going on. I don’t need admin access. If this is possible, send me a PM with the site details.

@simon just set you up with a membership. You should have received an email to set a password. LMK? TIA.

1 Like

I’ve also created an account on my site and PM’d you the details.

1 Like

@TGP Can you try changing your Discourse logout redirect setting to it seems that non www requests are being redirected to the www URL, but that the request=logout query parameter is not being preserved in the redirect.

This may not solve the issue, but it would be good to rule it out as a cause.


It seems likely that the logout issues on these sites are not related.

@robtech when I log out of your Discourse site, I am also logged out of your WordPress site, so this part of the logout process seems to be working correctly on your site. The issue I’m finding is with syncing logouts from WordPress to Discourse. Logging out of your WordPress site is not logging me out of your Discourse site.

Can you make sure that the API Key and Publishing Username you have set on the WP Discourse Connection tab are correct? You need to use an admin API Key and username. The easiest option is to use your site’s Master API Key and use ‘system’ as the publishing username. You should see a notice saying that you are “connected to Discourse” after saving the options on this page. Admin credentials are required in this section so that users can be logged out of Discourse when the logout of WordPress.

Let me know if this doesn’t solve the issue.


You’re correct, that has solved the issue for me. I think I had that working on a previous install and then forgot to update the API key when I did a fresh install, not realising because everything else seemed to be working. Thanks a lot for your help.

1 Like

Just to chip in some info from my setup:
I’m using

1 Like