How/where can I disable WP email notifications for commenting on own posts?
I want to do this globally for all users on the site, not only per-user through WP admin.
Are there any hooks which I can use to cancel these emails?
Thanks!
How/where can I disable WP email notifications for commenting on own posts?
I want to do this globally for all users on the site, not only per-user through WP admin.
Are there any hooks which I can use to cancel these emails?
Thanks!
Comments are closed.
The function that sends emails to the post author is called
wp_notify_postauthor()
and is located in/wp-includes/pluggable.php
. This means that the function is “pluggable” and can be overridden by another function with the same name. We can make a simple plugin to do this.This is the code we’ll be adding to the function to check if the author is posting on his own comment.
And here is the completed plugin for WordPress version 3.6. This needs to be saved in a PHP file called
custom-author-notification.php
and saved in a folder calledcustom-author-notification
in your plugins directory/wp-content/plugins/
.