-
Pingback is a method commonly used in blogs to notify the blog system of the citations of articles. The 3G blog network translates it as "broadcast", which refers to the computer system sending reference information to the outside, but some people think it will be confused with the broadcast in daily life. A method for web authors to be notified when others link to their pages. This method allows Web authors to track who links to their articles. Some blogging software, such as WordPress, have the function of automatically pinging back all the links in an article when it is published.
The above explanation of Pingback comes from Wikipedia. For WordPress, to put it simply, pingback means that when someone else reprints/cites your article link, it will automatically add a source link at the bottom of your article (of course, provided that your WordPress theme supports this function). This function is quite practical, because in most cases, the links cited are related to the original text, or have extended content, and readers can follow the links to read more information of interest.
In the same way, if an article cites a link to another article written before on your own site, then the previous article will receive a pingback from your own site. But I think generally speaking, the relevant log function can be used to build internal links for in-site links. Pingback is redundant for in-site articles, and this function can be turned off.
The method is as follows, add the following code in functions.php of the WordPress theme:
function no_self_ping( &$links ) {
$home = get_option( 'home' );
foreach ( $links as $l => $link )
if ( 0 === strpos( $link, $home ) )
unset ($links[$l]);
}
add_action ( 'pre_ping', 'no_self_ping' );
If I remember correctly, the predecessor of this code is a plug-in, but is it too luxurious to use a plug-in just for these few lines of code? If you can save it, save it. It is better to extract it into a non-plugin and integrate it into the theme. It will save you more worry.
Author: Wange
Article source: Life Studio