WordPress Notify Author on Comment

By default, WordPress does not notify the post author when they comment on their own post. They also don’t get notified after approving someone else’s comment on their post.

Apparently this lack of notification was introduced in 3.1. The Notify Me! plugin solved the problem for me for many years, but does not seem to work with my new theme.

Starting in WordPress 3.8, a filter hook was added that allowed overriding this default. 

The comment_notification_notify_author hook can be found in the source code for pluggable.php; in WordPress 4.7.4, that’s here.

Adding the following code to functions.php (in my case, in a child theme) should override the default, setting $notify = true.

function my_comment_notification_notify_author($notify) {
    return true;
}
add_filter('comment_notification_notify_author', 'my_comment_notification_notify_author');

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.