# Wordpress SSO - Restrict Content / user levels / groups

**URL:** <https://meta.discourse.org/t/wordpress-sso-restrict-content-user-levels-groups/57776>\
**Category:** WordPress\
**Created:** [February 22, 2017, 10:53am UTC](https://meta.discourse.org/t/wordpress-sso-restrict-content-user-levels-groups/57776 "2017-02-22T10:53:56Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![deere](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@deere](https://meta.discourse.org/u/deere)\
**Post date:** [July 24, 2020, 1:19pm UTC](https://meta.discourse.org/t/wordpress-sso-restrict-content-user-levels-groups/57776/9 "2020-07-24T13:19:30Z")

</div>

> [@simon](#):
>
> try creating a `debug.log` file on your WordPress server and then writing to that file from your `rcpdc_add_member_to_group` function.

Thanks, Simon! Worked a treat. I got the code working. Turns out the code wrapped around the action was preventing the add\_action from running the function. Once I removed the

```php
if ( class_exists( '\WPDiscourse\Discourse\Discourse' ) ) {

```

and just included the add\_action itself, the plugin worked fine. I’m not really worried about the check, because I’m the only person administering this site. So yeah, now syncing works perfectly for both adding and removing members from groups.

Thanks again for your fast and helpful reply.

---

_[View the full topic](https://meta.discourse.org/t/wordpress-sso-restrict-content-user-levels-groups/57776)._
