Hello,
Thank you for contacting Rank Math today.
This will require a huge level of customization to write a custom function to extract the first image from the_content() which we may not be able to provide since we are a small team.
I can suggest that you hire a freelance developer to get this done for you and then he/she can pass the image value to the product schema using the following filter:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
$entity['image']['url'] = 'URL here';
$entity['image']['width'] = 'Width here';
$entity['image']['height'] = 'Height here';
return $entity;
});
Looking forward to helping you. Thank you.
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.