Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
We have made a change recently to set the data inside the Schema markup to be the SEO title and description instead of the previous implementation using the actual product title and description from WooCommerce.
Please note that this will actually be beneficial in terms of SEO because the metadata that will be passed to Google will be the same as the Schema data and it’s easier for Googlebot to understand the data.
However, the WooCommerce Product Schema is an automatic Schema, but you can use and customize the following filter to change the product name value: https://rankmath.com/kb/filters-hooks-api-developer/#change-post-schema-data
Hope that helps.
Thank you.
Hi,
In my opinion, it was a mistake to use the SEO title for the Product name. If this value goes into Merchant Center or another similar place, it won’t make sense. The SEO title really only makes sense as the SEO title.
In any case, if I have to customize to change that, I’m a bit confused by the instructions on the provided help page. I understand that I need to customize the code snippet from the #10 example? I’m not sure exactly how it should be customized.
Side note — I’m a bit confused as to the source of the issue — you said that RM made a change to use the SEO title, but then you say the schema is provided by WooCommerce. Am I missing something?
Hello,
Yes, you can use the #10 filter to change the current structure of the automated Woocommerce Product schema.
You can use the filter like so:
add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
$entity['name'] = 'Name';
return $entity;
});
Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/
The change was applied in version v1.0.97
and you can read the details here: https://rankmath.com/changelog/free/v1.0.97/
Hope this helps. Let us know if you need any other assistance.
So I added this exact code and as far as I can tell it does nothing. Am I missing something?
Hello,
Sorry for the confusion caused. The code snippet was meant as a starting a starting point. I dug a little deeper to make the actual code snippet that sets the page title instead of “Name” as the current snippet you have does. Please replace the snippet with the one below:
add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
global $post;
$entity['name'] = get_the_title();
return $entity;
});
Hope that helps. Please let us know if you have questions.
Perfect. That solved it. Thanks!
Hello,
I am happy it helped you. Do you have any other questions or do you want us to mark this as solved?
Thank you.
That’s all for now. Thank you!
Hello,
If you have any questions in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.