Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
You can use this filter to add the articleBody schema on your site:
/**
* 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 ) {
$entity['articleBody'] = wp_strip_all_tags(get_the_content());
return $entity;
});
And here’s how you can add the filter:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope that helps.
Thank you.
Thanks. Can i apply same way for AMP pages? Specially in “AMP for WP – Accelerated Mobile Pages” plugin?
Hello,
Yes, that filter will be applied to them since it targets all of your pages where the article schema is being used.
You can verify that as well using these tools:
https://search.google.com/test/rich-results
https://validator.schema.org/
Looking forward to helping you.
Thank you.
Thank you so much. My last question is : I have breadcrumb enable in my theme (wordpress) as built-in. So i should enable breadcrumb in Rankmath or should desable from theme? or can enable from both side?
Hello,
I would suggest disabling the breadcrumbs from your theme.
Our breadcrumbs support adding the breadcrumbs schema for Google to easily determine the structure of your content.
To enable our breadcrumbs globally, you need to apply the PHP code to your theme file. Please refer to this guide: https://rankmath.com/kb/breadcrumbs/#add-breadcrumbs-theme
If you are not sure about it, you may contact your theme author on where to insert the breadcrumbs code in the theme file to display the breadcrumbs in your desired location on the frontend.
Hope that helps and please do not hesitate to let us know if you need my 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.