This snippet disables schema markup for particular post types, ensuring that the content is not marked up with unnecessary data for search engines.
add_filter( 'aioseo_schema_graph', function ( $schemaGraph, $type ) {
if ( is_singular( 'custom_post_type' ) ) {
return [];
}
return $schemaGraph;
}, 10, 2 );