現在這些插件真的是煩的很,網站後台各種廣告也就算了,前台源代碼裏也不忘了給自己宣傳,真是夠了。

安裝 Yoast SEO 插件後,會在源代碼中出現一串下面的文字:
<!-- This site is optimized with the Yoast SEO plugin v9.6 - https://yoa.st/1yg?utm_content=9.6 -->
雖然是註釋掉了的,但看着就是不爽,刪掉的代碼如下:
將下面代碼,添加到你主題或者子主題的 functions.php 文件裏。
// Remove All Yoast HTML Comments
//if (defined('WPSEO_VERSION')) {
add_action('wp_head',function() { ob_start(function($o) {
return preg_replace('/^\n?\<\!\-\-.*?[Y]oast.*?\-\-\>\n?$/mi','',$o);
}); },~PHP_INT_MAX);
//}
保存後前台去刷新看,就沒有了。