How to disable Yoast SEO schema from homepage only?

Many of us love to have our own Schema on the homepage. But Generally Rankmath, Yoast have their own Schema codes implemented. This hack removes the default schema of Yoast Plugin from homepage.

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 );  

Copied From: https://wordpress.stackexchange.com/questions/369862/how-to-disable-yoast-seo-schema-from-homepage-only

Leave a comment