I figured out something else. But would still love to know why you don’t have the standard options available.
Ok. I am going to do it manually page by page, but am running into issues. Made a schema for an organization, but for some reason, it is always putting PERSON schema first. There is also a lot of other nonsense that is being added. How do I turn that off? Trying really hard to stay with Rank Math, but RM is not making it easy.
Thank you.
I installed the PHP code
/**
* Filter to change the schema data.
* Replace $schema_type with schema name like article, review, etc.
*
* @param array $entity Snippet Data
*
* @return array
*/
add_filter( “rank_math/snippet/rich_snippet_{$schema_type}_entity”, function ( $entity ) {
if ( isset( $entity[‘author’] ) ) {
unset( $entity[‘author’] );
return $entity;
}
return $entity;
} );
Now the Rank Math options are gone and I can’t use Rank Math.
Hello,
Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.
The Schemas like Website, Webpage, and Organization are the default Schemas of Rank Math and are added to your whole site. You don’t have to add them manually. To put the information about your organization as structured data, please enable the Local SEO module from WP Dashboard > Rank Math > Dashboard and add the info in WP Dashboard > Rank Math > Titles & Meta > LocalSEO.
To add the SameAs Schema to your site, please modify and use the following filter in your theme’s functions.php file:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
if ( isset( $data['Organization'] ) ) {
$data['Organization']['sameAs'] = [
'https://twitter.com/RankMath',
'https://facebook.com/Rankmath'
];
}
return $data;
}, 99, 2 );
And the filter that you have used to unset the author, you will have to replace the {$schema_type} with the name of the Schema from which you want to unset the author. If you want to do it from the Article Schema then the filter will look like this:
/**
* Filter to change the schema data.
* Replace $schema_type with schema name like article, review, etc.
*
* @param array $entity Snippet Data
*
* @return array
*/
add_filter( "rank_math/snippet/rich_snippet_article_entity", function ( $entity ) {
if ( isset( $entity['author'] ) ) {
unset( $entity['author'] );
return $entity;
}
return $entity;
} );
Hope this helps. Let us know if you need any other assistance.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
The Schema Templates is a PRO feature and your subscription status is set as a Free user. Can you please share the email address that you have used to purchase the PRO version so we can check and assist you further?
Looking forward to helping you.
Thanks.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
I just put it in the private section. Thank you.
Hello,
Thanks for sharing the email address. To remove the Schemas please use the following filter: https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data
Here is an example of how to remove the Person Schema:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
unset($data['ProfilePage']);
return $data;
}, 99, 2);
And the imageObject Schema is added for the Logo of your organization that you have set in the WP Dashboard > Rank Math > Titles & Meta > LocalSEO. You will also have to select a Business type and fill in the details in the Local SEO module to apply the Organization Schema.
And the Schema templates that you have created are saved as drafts. Please edit them and click on save to publish them. Once published use the Display Conditions to apply them to the pages you want: https://rankmath.com/kb/schema-templates/#display-based-on-conditions
Hope this helps. Let us know if you need any other assistance.
Thanks.
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.