How to Deactivate the Discourse Activation Email

Unless the default WordPress New User Notification email is sent as a part of your WordPress registration process, the plugin sets the SSO parameter require_activation to true. There is a hook that you can use to bypass this. The hook is called discourse_email_verification. It passes two parameters:

  • $require_activation - whether or not the email address has been validated by WordPress
  • $user - the WordPress user object

If you want to disable email validation for all users, then you don’t need to use the parameters. You can add something like this to your theme’s functions.php file or a plugin:

Note: don’t use this unless you know that your user’s email addresses are valid.

add_filter( 'discourse_email_verification', 'wpdc_custom_disable_email_verification' );
function wpdc_custom_disable_email_verification() {

    return false;
}
8 Likes