Support » Plugin: Comments - wpDiscuz » Why is anonymous @example.com email address created?

  • Resolved wordmax

    (@wordmax)


    We have it set so people are not required logon or to enter email to submit comments which is how we want it to be. However when people submit the comment we see in the admin view that comments submitted w/ no email addresses are given the same 613bc463b91fb@example.com email address by the wpdiscuz plugin. We’d rather have NO email address associated w/ the comment when (non logged in guest) user submits comments and chooses not to enter an email address.

    Please advise on solution for this.
    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support gVectors Support

    (@gvectorssupport)

    Hi wordmax,

    The email field is required for WordPress comments. Although it’s allowed not to fill the email field from the frontend, the wpDiscuz adds some generated emails to avoid conflict with WordPress. This allows the comments to be published successfully.

    Thread Starter wordmax

    (@wordmax)

    Thanks. So I suppose that just using a no-reply@websitedomain.com would not work just as well? Where “websitedomain” would be the domain where the site is installed.

    Plugin Support gVectors Support

    (@gvectorssupport)

    This is done for finding differences between anonymous users. Otherwise, it’ll show as the same user made the comments.

    The code below makes it work as you want:

    add_filter('wpdiscuz_commenter_email', function($email){
        if(strpos($email,'@example.com')){
            $email = 'no-reply@websitedomain.com';
        }
        return $email;
    });

    Put the code in the active theme functions.php file.

    Here is an instruction on how to easily add custom code in WordPress (without Breaking Your Site): https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.