Hello,
We apologize for the inconvenience you’re experiencing with removing the Schema from your posts and pages. It seems that the Schema is still present despite your attempts to remove it using the Rank Math menu.
To completely remove the Schema generated by Rank Math, you can disable the Schema module by heading to your WordPress dashboard, then navigating to Rank Math SEO → Dashboard, and disabling the Schema module.
If you’ve already tried this and the Schema is still present, you may need to remove the Schema types added to a post under the Schema tab of Rank Math’s Meta Box. You can do this by following the steps outlined in our tutorial here.
If you’re still encountering issues after following these steps, please feel free to reach out to our dedicated support team directly from here, and we’ll be more than happy to assist you further.
We appreciate your understanding and patience as we work to resolve this issue for you.
Sources:
Removing Schema From Your Posts & Pages » Rank Math
Resolving Rank Math Schema Markup Related Issues
How to Use Schema Templates in Rank Math PRO » Rank Math
Bulk Editing Options in the Rank Math SEO Plugin
Why You Shouldn’t Duplicate Posts/Pages » Rank Math
Hello,
Thanks for reaching out to Rank Math support. We’re glad to help you with your query.
We understand that you want to remove Rank Math schemas from your website and add your own custom schema instead. First, can you please confirm if you want to remove the default schema from some posts or all posts on your website? Also, how are you adding your custom schema? Are you planning to use the Custom Schema or Schema Templates features of the PRO version of Rank Math, or are you using a different method?
The steps to remove the default schema will depend on your answers to these questions. For example:
- If you are still using Rank Math schemas and you only want to remove the default ones, you can use this code snippet in your child theme’s
functions.php
or rankmath.php
file:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if (isset( $data['publisher'] ) ) {
unset( $data['publisher'] );
}
unset($data['WebPage']);
unset($data['WebSite']);
unset($data['ImageObject']);
return $data;
}, 99, 2);
- If you are adding your custom schema with another method and you want to remove all of Rank Math’s schema from your website, you can use this code snippet instead:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
return false;
}, 99, 2);
You can add these code to your website using any of the methods listed here https://rankmath.com/kb/wordpress-hooks-actions-filters/
One more thing to note: we saw your screenshot and noticed that you are looking for the schema added with the rank-math-schema
class. This class is used for all schemas added by Rank Math, not just the default ones. So you will only not see this class if you are not using Rank Math schema at all.
We hope this clears up the confusion and helps you achieve your desired result. If you have any other questions or issues, please don’t hesitate to contact us again.
Thank you for choosing Rank Math
Hey there,
thank you for taking the time 🙂 I will choose Rankmath in the near future I suppose – but I am currently founding and wanted to pay for work related “software” as soon as I am able to pay via commercial account.
As for the questions – I’d like to remove Rankmath Schema only from a certain page, not from the whole website. I added Rankmath Schema for Persons which was available to choose from multiple Schemas inside Rankmath free.
Thank you 🙂
Hello,
You can set a condition in the filter to check for the page ID if you only want to remove the Schema from a single page:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if (get_queried_object_id() == '123' ) { //replace 123 with the page ID
unset( $data['publisher'] );
unset( $data['ProfilePage'] );
unset($data['WebPage']);
unset($data['WebSite']);
unset($data['ImageObject']);
}
return $data;
}, 99, 2);
Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.
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.