# How to turn off Discourse email verification?

**URL:** https://meta.discourse.org/t/how-to-turn-off-discourse-email-verification/75365
**Category:** WordPress
**Created:** [4 Dicembre 2017, 7:48pm UTC](https://meta.discourse.org/t/how-to-turn-off-discourse-email-verification/75365 "2017-12-04T19:48:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander\_Oskin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexander_oskin/32/83803_2.png) [@Alexander\_Oskin](https://meta.discourse.org/u/Alexander_Oskin)
#### Post date: [4 Dicembre 2017, 7:48pm UTC](https://meta.discourse.org/t/how-to-turn-off-discourse-email-verification/75365/1 "2017-12-04T19:48:59Z")

</div>

We use our Wordpress instance as SSO provider for Discourse. After user registered Wordpress account he confirm his email address. But when he trying to log in to Discourse he asked by Discourse to confirm his email again. Is there any way to avoid email confirmation by Discourse?

---

<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: [4 Dicembre 2017, 7:52pm UTC](https://meta.discourse.org/t/how-to-turn-off-discourse-email-verification/75365/2 "2017-12-04T19:52:00Z")

</div>

> [@Alexander\_Oskin](#):
>
> After user registered Wordpress account he confirm his email address.

How is the user confirming their email address? Are you using the default WordPress registration page, or a front-end registration page?

---

<div class="post-metadata">

### Author: ![Alexander\_Oskin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexander_oskin/32/83803_2.png) [@Alexander\_Oskin](https://meta.discourse.org/u/Alexander_Oskin)
#### Post date: [4 Dicembre 2017, 7:56pm UTC](https://meta.discourse.org/t/how-to-turn-off-discourse-email-verification/75365/3 "2017-12-04T19:56:01Z")

</div>

We are using front-end (custom) registration page. Is there any difference?

---

<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: [4 Dicembre 2017, 8:12pm UTC](https://meta.discourse.org/t/how-to-turn-off-discourse-email-verification/75365/4 "2017-12-04T20:12:38Z")

</div>

> [@Alexander\_Oskin](#):
>
> We are using front-end (custom) registration page. Is there any difference?

Yes, WordPress doesn’t require email addresses to be verified, but it’s important for Discourse that the email address is verified (that it belongs to the user who has registered.) The [WP Discourse](https://github.com/discourse/wp-discourse) plugin hooks into the WordPress registration process and verifies that the email sent by `wp_new_user_notification` was responded to. It’s not possible for the plugin to do this with custom registration systems, so if one of those systems is being used, it forces Discourse to verify the email address.

If you know that your user’s email address are verified, you can add a function that hooks into the `discourse_email_verification` filter. It passes two parameters: `$require_activation` and `$user_id`

Something like this will work. Be careful about this though. The conditional in the function should be dependent on something that happens in your registration process that lets you know the email address has been verified.

```php
add_filter( 'discourse_email_verification', 'wpdc_custom_discourse_email_verification', 10, 2 );
function wpdc_custom_discourse_email_verification( $require_activation, $user_id ) {
    if (/* some condition */) {
        $require_activation = false;
    }

    return $require_activation;
}

```
