WordPress终极优化指南–禁用自我Pingbacks
Warning: Undefined variable $output in /home/wwwroot/xiaoyuo.com/wp-content/themes/ripro-child/functions.php on line 68
本文共441个字,预计阅读时间需要2分钟 发布时间: 2024-10-4 共3.08K人阅读
WordPress终极优化指南–禁用自我Pingbacks
教程总目录:WordPress终极优化指南
当你自己文章里调用了自己的某个文章链接时候wordpress会创建一个自我Pingbacks,这个东西没有什么价值。知识兔可以禁用。
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' );
写入functions.php保存即可
下载仅供下载体验和测试学习,不得商用和正当使用。
常见问题FAQ
Warning: foreach() argument must be of type array|object, string given in /home/wwwroot/xiaoyuo.com/wp-content/themes/ripro-child/parts/author-box.php on line 12