Skip to content

Instantly share code, notes, and snippets.

@WPprodigy
Last active November 3, 2018 03:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save WPprodigy/77578d926dc830e33cf6acc6aaf7c768 to your computer and use it in GitHub Desktop.
Disable WordPress email notifications for pingbacks and trackbacks.
<?php
// Don't send notification emails for pingbacks and trackbacks.
add_filter( 'notify_post_author', function( $maybe_notify, $comment_ID ) {
$comment_type = get_comment_type( $comment_ID );
if ( in_array( $comment_type, array( 'pingback', 'trackback' ), true ) ) {
$maybe_notify = false;
}
return $maybe_notify;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment