How to Disable Self Pingbacks in WordPress

// prevent self-pings
function shapeSpace_prevent_self_pings(&$links) {
	
	$home = get_option('home');
	
	foreach ($links as $l => $link) {
		
		if (0 === strpos($link, $home)) unset($links[$l]);
		
	}
	
}
add_action('pre_ping', 'shapeSpace_prevent_self_pings');
Manuel Campos, English Professor

Manuel Campos

I am José Manuel. I am writing about things I know and things that I am learning about WordPress. I hope you find the content of this blog useful.

WP SURFER

home

about

privacy

contact

© 2024 WP SURFER • Made with Love in Costa Rica