0

Our WordPress site is using Yoast premium for SEO support. Does anyone know how to remove the Yoast schema from a specific CPT - Blogs - without removing it sitewide?

My current attempt is the following code in functions.php, from Yoast forums, but the schema is still there:

add_filter( 'wpseo_json_ld_output', 'extreme_maybe_output_schema' );
function extreme_maybe_output_schema() {

  if (is_home() || is_singular('post') || is_post_type_archive('post')) {
    return false; // Disables schema output on the blog 'homepage', individual posts, and post archives.
  }
  return true;
}

Anyone know how this can be accomplished? Thanks.

1
  • This question appears to be off-topic because it is about WordPress development. This may be a better fit at the WordPress Development Stack Exchange website. Be sure to read their FAQ before posting to make sure your question meets their requirements.
    – John Conde
    Nov 19 at 13:37