Hello,
To output Schema data in the WordPress header, you can utilize Rank Math’s filters and hooks. Here is an example of how you can achieve this:
-
Filter to Remove BreadcrumbList Schema:
add_filter( 'rank_math/json_ld/breadcrumbs_enabled', '__return_false' );
-
Filter to Extend JSON-LD Data:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
// Add your article schema data here
return $data;
}, 99, 2);
-
Filter to Remove CollectionPage Schema on Taxonomy Pages:
add_filter( 'rank_math/snippet/remove_taxonomy_data', function( $value, $taxonomy ) {
return $value; // true or false
}, 10, 2);
You can add these filters to your theme’s functions.php file or create a rank-math.php file in your theme folder and add the code snippets there.
If you need further assistance or have specific requirements, feel free to reach out to our support team directly here.
Best regards.
Sources:
Rank Math SEO Filters and Hooks for Developers – Rank Math
Remove All Schema from Product Category Pages » Rank Math
Removing Schema From Your Posts & Pages » Rank Math
How to Use ACF Repeater Fields to Automate FAQ Schema » Rank Math
Remove Organization Schema from Your Website » Rank Math
Hello,
Unfortunately, all Rank Math’s schema is placed inside the script type="application/ld+json" class="rank-math-schema">.
However, all the meta tags added by Rank Math are placed inside your website’s header tag <head>.
Looking forward to helping you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.