Hello,
Thanks for contacting us, and sorry for any inconvenience that might have been caused due to that.
When there’s a image in a product page, Rank Math automatically set that image for og:image property and ignores the default OpenGraph image. This is an intended behavior of Rank Math.
However, you may set a default one for all of your products in your site by applying the following filter:
//For og:image
add_filter( "rank_math/opengraph/facebook/image", function( $attachment_url ) {
if (is_product()) {
$attachment_url = 'YOUR-IMAGE-URL-HERE'; //set image URL here
}
return $attachment_url;
});
//For twitter:image
add_filter( "rank_math/opengraph/twitter/image", function( $attachment_url ) {
if (is_product()) {
$attachment_url = 'YOUR-IMAGE-URL-HERE'; //set image URL here
}
return $attachment_url;
});
Here’s how you can add filters/hooks to your site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/
Let us know how it goes. Looking forward to helping you.
Thank you.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me 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 do 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.