how to disable Yoast SEO schema from homepage only?

I know it can be disabled everywhere withadd_filter( 'wpseo_json_ld_output', '__return_false' );But

I know it can be disabled everywhere with

add_filter( 'wpseo_json_ld_output', '__return_false' );

But i want to keep the breadcrumbs so if i could do that only if (is_home()) that would be perfect. I just don't know where to hook it.

I know it can be disabled everywhere with

add_filter( 'wpseo_json_ld_output', '__return_false' );

But i want to keep the breadcrumbs so if i could do that only if (is_home()) that would be perfect. I just don't know where to hook it.

Share Improve this question asked Jun 26, 2020 at 20:54 Michael RogersMichael Rogers 5498 silver badges37 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

try like this

function filter_wpseo_json_ld_output( $bool, $context ) { 
    if(is_home()){ return false; }
    return $bool; 
}; 
// add the filter 
add_filter( 'wpseo_json_ld_output', 'filter_wpseo_json_ld_output', 10, 2 ); 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742315721a4420798.html

相关推荐

  • how to disable Yoast SEO schema from homepage only?

    I know it can be disabled everywhere withadd_filter( 'wpseo_json_ld_output', '__return_false' );But

    12小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信