No pingbacks to your own posts
When you link to one of your own posts, WordPress sends it a pingback, which shows up as a comment. This stops that.
<?php
add_action(
'pre_ping',
static function ( &$links ) {
$home = home_url();
foreach ( $links as $i => $link ) {
if ( str_starts_with( (string) $link, $home ) ) {
unset( $links[ $i ] );
}
}
}
);
In these packs
- Performance: Small changes that save the server and the browser some work.