You can exclude Schema JSON-LD markup from specific post types by using the following filter.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
add_filter( 'wpsso_json_prop_https_schema_org_graph', 'exclude_schema_graph_by_post_type', 10, 2 ); function exclude_schema_graph_by_post_type( $prop_data, $mod ) { if ( 'a-post-type-name' === $mod[ 'post_type' ] ) { return __return_empty_array; } return $prop_data; } |
See the $mod variable documentation for more information on the $mod array and its elements.