• I recently updated one of my WP sites for the first time in several months, and I’m now getting notifications to the admin email address for every comment posted.

    I am not the author of any of the posts, and I’ve gone into Settings/Discussion and made sure the notification options – Email me whenever?Anyone posts a comment & Email me whenever A comment is held for moderation – are unchecked.

    I’ve tried checking those boxes, saving the settings, then unchecking them and saving again. No luck. I can’t find any other setting to disable comment notifications.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Do you wish to completely disable comment notifications? Or only the admin notification, letting authors still get notifications? (authors are only notified if they are able to moderate comments)

    This code added to a theme’s functions.php or some plugin code should completely disable comment notifications (untested):
    add_filter('notify_moderator', '__return_false', 999 );

    To not notify admin but notify authors capable of moderating, the admin email can be removed from the array of recipients through the ‘comment_moderation_recipients’ filter.

    Thread Starter PostmasterGS

    (@postmastergs)

    Thank you for the response.

    I don’t want to disable all notifications, only those to the admin.

    Can you elaborate on what this means – the admin email can be removed from the array of recipients through the comment_moderation_recipients’ filter?

    Moderator bcworkz

    (@bcworkz)

    Doc page for the filter. Sadly no examples of usage ??

    The logic you’d apply within the filter callback depends on your specific need. Usually two emails are passed, but if the post author is the admin, then only one email is passed. I believe the admin email is always the first element. In one scheme you could simply unset the first element and return the resulting one element array. But if the admin is the post author they will not get any notification. You may want to apply additional logic to account for admin post authors. Or maybe it’s not something that happens on your site.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can’t Disable Comment Notifications’ is closed to new replies.