方法其实很简单,在wordpress的当前主题函数文件functions.php当中添加这组代码并保存即可: //移除头部dns-prefetch function remove_dns_prefetch( $hints, $relation_type ) { if ( 'dns-prefetch' === $relation_type ) { return array_diff( wp_dependencies_unique_hosts(), $hints ); } return $hints; } add_filter( 'wp_resource_hints', 'remove_dns_prefetch', 10, 2 ); 是不是很简单? 未经允许不得转载:泥人传说 » 通过wordpress主题函数移除head头部dns-prefetch标签的终极代码 wordpress主题函数移除head头部dns-prefetch标签wordpress移除dns-prefetch标签wordpress移除头部多余代码移除dns-prefetch标签 分享到: 赞(0)