Hello,
Thank you for contacting us.
By default, we only use Article and Product og:types where Product is for WooCommerce products, and for the rest, we use the Article og:type.
However, you can use the below filter to change the og:type as per your requirement:
https://rankmath.com/kb/filters-hooks-api-developer/#1-filter-to-change-opengraph-type-ogtype
You can use the code like the below one:
/**
* Allows theme developers to change the OpenGraph type of the page.
*
* @param string $type The OpenGraph type string.
*/
add_filter( 'rank_math/opengraph/type', function( $type ) {
$post_types = ['services']; //separate the post types with a comma
if(in_array( get_post_type(), $post_types )){
return "Website";
}
return $type;
});
The above code changes the og:type of “services” post type to “Website”. If you wish to apply the code to multiple post types, then you can separate the post type name with a comma in $post_types array.
Here’s a guide to add the filter:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Hope this helps.
Thank you.
It works properly. Thank you!
Hello,
We are super happy that we could address your concern. If you have any other questions in the future, know that we are here to help you.
If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.