This issue still persists and I had to create a function to resolve this:
add_filter( 'wpseo_json_ld_output', 'disable_yoast_schema_for_specific_post_types', 10, 1 );
function disable_yoast_schema_for_specific_post_types( $data ) {
// List of post types where you want to disable Yoast schema
$disabled_post_types = array( 'post', 'page' ); // Add or remove post types as needed
// Check if we're on a singular post/page and if the current post type is in our disabled list
if ( is_singular() && in_array( get_post_type(), $disabled_post_types ) ) {
return false; // This will disable the schema output
}
return $data; // Return the original data for other post types
}
The page I need help with: [log in to see the link]