[ad_1]
For example, the code below removes the organization schema from all pages except the home page.
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if ( is_front_page() || ! isset( $data['publisher'] ) ) {
return $data;
} unset( $data['publisher'] );
unset( $data['place'] ); return $data;
}, 99, 2);I need code to delete organization, website, web page schema from all pages.
Hello @sizinajans,
Thank you for contacting the support.
Please use the filter given below to remove the default Schemas added by our plugin:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
unset($data['publisher']);
unset($data['WebSite']);
unset($data['WebPage']);
return $data;
}, 99, 2);Here is how to add a filter to your site:
Hope this helps. Let us know if you need any other assistance.
