我在我的博客上安装了wordpress SEO Yoast插件.我想避免使用SEO Yoast为我的博客生成标题.有什么方法可以删除SEO Yoast插件应用的过滤器wp_title()
吗?我想使用页面标题作为SEO标题.
add_filter( 'wp_title', 'te_before_filter_wp_title' );
function te_before_filter_wp_title( $title ) {
echo $title;
//exit;
return $title;
}
add_filter( 'wp_title', 'te_after_filter_wp_title' ,9999);
function te_after_filter_wp_title( $title ) {
echo $title;
//exit;
return $title;
}
Run Code Online (Sandbox Code Playgroud)
我已经编写了这段代码来测试标题.而在标题te_before_filter_wp_title
和te_after_filter_wp_title
是不同的.所以它被SEO YOAST插件修改.