# Get Discourse to recognize accounts verified in Wordpress (and WooCommerce) for SSO

**URL:** <https://meta.discourse.org/t/get-discourse-to-recognize-accounts-verified-in-wordpress-and-woocommerce-for-sso/137535>\
**Category:** WordPress\
**Created:** [2 בינואר,‏ 2020,‏ 6:51am UTC](https://meta.discourse.org/t/get-discourse-to-recognize-accounts-verified-in-wordpress-and-woocommerce-for-sso/137535 "2020-01-02T06:51:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [2 בינואר,‏ 2020,‏ 6:12pm UTC](https://meta.discourse.org/t/get-discourse-to-recognize-accounts-verified-in-wordpress-and-woocommerce-for-sso/137535/3 "2020-01-02T18:12:37Z")

</div>

> [@jord8on](#):
>
> Would using that ⬆︎ code snippet be the solution to what I’m trying to accomplish?

As long as the Booster for WC plugin prevents users from being able to login to WordPress before they have verified their email address, that code will be safe to use. When added to your theme, or to a plugin, it will allow users to login to your Discourse site without having to re-verify their email address.

> [@jord8on](#):
>
> Is there a way to get Discourse to check who is actually verified based on the metadata that is being received from WooCommerce?

This would also be possible. If you know the name of the metadata key that is being set by Woocommerce and the expected return value for users with verified email addresses, you could add a check for that to the function. Something like this:

```php
add_filter( 'discourse_email_verification', 'wpdc_custom_discourse_email_verification', 10, 2 );
function wpdc_custom_discourse_email_verification( $require_activation, $user_id ) {
    if ( 1 === get_user_meta( $user_id, 'wc_metadata_key', true ) ) {
        $require_activation = false;
    }

    return $require_activation;
}

```

If you are running into any SSO login redirect issues with Woocommerce, you may need to install this plugin on your site: [GitHub - scossar/wp-discourse-woocommerce-support: Integrates the wp-discourse plugin with WooCommerce · GitHub](https://github.com/scossar/wp-discourse-woocommerce-support). Have a look at the plugin’s readme for details about what it does.

---

_[View the full topic](https://meta.discourse.org/t/get-discourse-to-recognize-accounts-verified-in-wordpress-and-woocommerce-for-sso/137535)._
