-
Hello,
Nice plugin, thanks, however have some bugs with the Structured Schemas.
I’m issuing with the Woocommerce taxonomy schema, that has CollectionPage structure with primaryImageOfPage and in this property is a @type of ImageObject with recently added product image URL.
It’s a standard bug, I notice that every website supported by Rank Math has this issue.
How can I change this URL with a taxonomy Open Graph image URL?
Thank in advance.
-
Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay.
I’m not quite sure whether I fully understand your concern. But I’ll do my best, and please let me know if I misunderstood.
The
primaryImageOfPagein your schema refers to the featured image you have set for that page.However, for us to advise accordingly, could you please also share the affected URL to further check? You can add it in the sensitive data section
It is completely secure, and only our support staff has access to that section.
Looking forward to helping you.
Thank you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
Thank you for getting back to us.
May I confirm from you if you have inserted any schema within the taxonomy page here? We do not recommend using unsupported schema types on this page. Infact, you should have the “remove snippets” turned on for your product categories.
Therefore if you have included any schema like products you can remove it as it will not make sense to have the reviews of your products schema on your categories hence the error shown here: https://i.rankmath.com/BkRESb
Aside from that, the CollectionPage schema is inserted internally by Rank Math and it shows on most taxonomy pages that have items. Does excluding the featured image resolve this issue from your taxonomies?
We are looking forward to helping you.
Thank you.Hello Brian,
There isn’t included a featured image of taxonomy for the CollectionPage, there is the featured image of the latest product.
I have done an og:image for this category which should normally be the value URL of primaryImageOfPage (in CollectionPage) but itsn’t. Can I set a primaryImageOfPage value URL with a taxonomy og:image URL?
Thank you.
Hello,
Thank you for getting back to us,
There isn’t included a featured image of taxonomy for the CollectionPage, there is the featured image of the latest product.
Yes, usually the taxonomy page itself does not have a primaryimageofPage entity. This part comes in once you add a product within the taxonomy as you have done.
The primaryimageofPage is from that product in the taxonomy which is why it has the
isPartOfproperty to show that it is just an addition to the main taxonomy schema.Changing this primaryImage to show the
og:imageURL instead, will lose meaning to the individual product schema since it uses the same PrimaryImageOfPage property with the same image ID.Please note that all these entities are interconnected and we do not recommend removing or changing any one entity from the Schema.
Changing this could end up breaking the schema structure of your pages across your site which is something you may not want.
Hope this helps. Please let us know if you have any other questions.
Hello Brian,
Ok, I got your recommendation appropriate for it. This is simply because I want to change a taxonomy image so that it would not mistakenly be indexed by Search Engines.
How am I able to index taxonomies images into Google (search engines)?
Google isn’t overwritten primaryimageofPage value with an Open Graph image data.
Thank you.
Hello,
Thank you for getting back to us.
Well, if you want to have the taxonomy images indexed on Google, the most important factors for image search is having a correct Alt text, a descriptive image name, also provide a correct title tag and a caption to the image to make it even more obvious what the image is about.
As we checked this given taxonomy via the Rich results Testing tool we do see the presence of PrimaryImageOfPage schema outputting the relevant image of the individual product in that category.
Furthermore, please note that it’s entirely up to Google to decide what to show in the search results. Apart from the schema markup for the primaryimage, there are other factors (i.e. authority, context, etc.) that Google may take into account to decide whether or not to display an image to your pages.
However in any case you feel like you want to extend the schema for the taxonomy pages you can always use the default schema extension filter here: https://rankmath.com/kb/filters-hooks-api-developer/#extend-json-ld-data
But still, this will not guarantee the indexing or showing of the correct image on Google especially since taxonomies like product categories have several product images within them. It may pick another image in your category as well.
Hope this is clear. In any case, you have other questions, please do not hesitate to raise them here again.
Thank you.Hello Brian,
‘As we checked this given taxonomy via the Rich results Testing tool we do see the presence of PrimaryImageOfPage schema outputting the relevant image of the individual product in that category.’
That image always will be the image of a recently added product and will change with great frequency (often). So I prefer to fix only one value (taxonomy image URL, og:image) and it would be constantly.
I hope I explained it clearly.
I appreciate such amazing attention, Brian.
Thank you.
Hello,
Hope you’re doing well. If we can’t technically change the image value, please tell me how do I disable only the CollectionPage schema or the primaryimageofPage property?
Thank you.
Hello
Thank you for getting back to us.
Sure in case you wish to get rid of the CollectionPage schema you can simply apply this filter to your theme’s functions.php file here:
https://rankmath.com/kb/filters-hooks-api-developer/#remove-collectionpage-schema
Please let us know if you have any other questions for us.
Thank youHello Brian,
This filter isn’t working :\
Will we see this bug fixed, in the next update?
Hello,
Thank you for getting back to us,
Well, the code I gave you in the previous reply seems to be only getting rid of the CollectionPage schema on the post taxonomies and not the product taxonomies.
Just noticed that the CollectionPage schema of the product categories is linked to the WebPage schema which is what you need to disable. Therefore you would have to target the product categories with this filter:
add_filter( 'rank_math/json_ld', function( $data, $jsonld ) { if( is_product_category() ) { unset($data['WebPage']); return $data; } }, 99, 2);Hope this helps. If you have any other additional questions please let us know.
Thank you.Hello Brian,
Thank you for your support, I really appreciate it.
I have got this warning from this filter 🙄
Warning: foreach() argument must be of type array|object, null given in /wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.php on line 174Please help to solve this 🙏
Thank you a lot!
Hello,
Thank you for getting back to us.
Usually, this error simply means that you have used some invalid schema data or you do have some empty values from the schema data.
Could you please let us know if there is a page referenced to this error? Or rather on which page did you see this error?
If you find the page please make sure that all fields of the schema used are fulfilled. However, you do not have to worry much about the warning.
Hope this helps. Please do let us know if you have any other questions.
The ticket ‘Woocommerce Taxonomies CollectionPage Schema primaryImageOfPage’ is closed to new replies.