Remove WordPress Pingback Emails From Your Own Domain
I'm not entirely sure why this isn't native functionality, but if you internally link to your own posts, you'll get emails when those posts go live. Here's an example from another business I own:

Thankfully you can disable this for your own domain only. After all, you don't really need to be notified each time you add an internal link... right?
Just drop this at the bottom of your functions.php file to solve this issue:
/**
* Disable self-pingbacks (pingbacks from your own domain)
*/
function disable_self_pingbacks(&$links) {
$home_url = get_option('siteurl');
$parsed_home = parse_url($home_url);
$home_domain = isset($parsed_home['host']) ? $parsed_home['host'] : '';
$home_domain = preg_replace('/^www\./', '', $home_domain);
foreach ($links as $key => $link) {
$parsed_link = parse_url($link);
$link_domain = isset($parsed_link['host']) ? $parsed_link['host'] : '';
$link_domain = preg_replace('/^www\./', '', $link_domain);
if ($home_domain == $link_domain) {
unset($links[$key]);
}
}
}
add_action('pre_ping', 'disable_self_pingbacks');
// XML RPC
function block_self_pingback_xmlrpc($source_uri) {
$home_url = get_option('siteurl');
$parsed_home = parse_url($home_url);
$parsed_source = parse_url($source_uri);
$home_domain = isset($parsed_home['host']) ? $parsed_home['host'] : '';
$source_domain = isset($parsed_source['host']) ? $parsed_source['host'] : '';
$home_domain = preg_replace('/^www\./', '', $home_domain);
$source_domain = preg_replace('/^www\./', '', $source_domain);
if ($home_domain == $source_domain) {
return false;
}
return $source_uri;
}
add_filter('xmlrpc_pingback_source_uri', 'block_self_pingback_xmlrpc');
// Prevent pingback emails from being sent about internal links on my own domain
function disable_self_pingback_emails($notify, $comment_id) {
$comment = get_comment($comment_id);
if ($comment && in_array($comment->comment_type, array('pingback', 'trackback'))) {
$source_url = $comment->comment_author_url;
$home_url = get_option('siteurl');
$parsed_home = parse_url($home_url);
$parsed_source = parse_url($source_url);
$home_domain = isset($parsed_home['host']) ? $parsed_home['host'] : '';
$source_domain = isset($parsed_source['host']) ? $parsed_source['host'] : '';
$home_domain = preg_replace('/^www\./', '', $home_domain);
$source_domain = preg_replace('/^www\./', '', $source_domain);
if ($home_domain == $source_domain) {
return false;
}
}
return $notify;
}
add_filter('notify_post_author', 'disable_self_pingback_emails', 10, 2);
function remove_pingback_header() {
if (isset($_SERVER['HTTP_X_PINGBACK'])) {
unset($_SERVER['HTTP_X_PINGBACK']);
}
}
add_action('init', 'remove_pingback_header');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
Did this help? Please let me know in the comments!
Comments