-
Hello,
On my site: https://www.gothicmerchant.com/
The woocommerce product image is not being shared when you click to share on Facebook. The default social share only displays. I tried checking on another product and it worked. So I tried again on another product and then it went back to the default social share image. It’s obviously important that the correct product image shows.
Can you help?
Thank you
Kind Regards,
Craig
-
Hello,
Thank you for contacting Rank Math about your product images not showing as social images on your website.
I checked several links and they showed the product image as the social image. However the last product I checked did not show the correct image: https://www.gothicmerchant.com/baroque-lion-sterling-silver-seal-ring/
Please check if a social image is set for the above-linked product by opening the product editor and opening the social tab in the Rank Math Metabox. If the wrong image is set in the Social Metabox you may remove it. screencast:https://i.rankmath.com/DcAFVK
If the correct image is in the metabox, then we might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section.
Please do take a complete backup of your website before sharing the information with us.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hi Nigel,
Thanks for your reply, I checked as you suggested. But the image is correct within the product edit page. I have included the FTP password and WordPress admin credentials. I hope you can resolve this.
Thanks again.
CraigHello,
I logged into your website’s admin area and upon checking the product page, I found that the social image is not explicitly defined, and the product image is getting picked.
However, since the product image is of dimensions 600px X 600px, it is not getting considered for the OG image and instead, the global default image is used.
Please ensure to set an image of the recommended dimensions (i.e, 1200px X 630px) and of the supported image types (jpeg, png, and gif).
Setting the image following the above points should fix the issue.
I tested by setting a dummy image of 1200px X 630px and it works properly.
Hope this helps.
Thank you.
Hi
Thanks for your response. We only have a max image size of 1000 x 1000 px. (I updated this now)
So, when I disable Rankmath, the social image is shared correctly. So what this tells me, is the issue with Rankmath. Is there a way to disable the default social image?
Or do you have another idea for me?
Thanks
Kind Regards,
CraigHello,
To block the fallback images and use only the product image, please add the following code snippet to your theme fuctions.php file:
add_action( 'rank_math/head', function(){ if ( is_product() ) { remove_all_actions('rank_math/opengraph/facebook/add_additional_images'); } }, 9 );That should fix it.
Hope that helps.
Thanks, Nigel, unfortunately, that doesn’t work.
I added the code to the child theme functions.php
Hello,
Before using an image in the OG tags, we run it through the OG-supported formats and dimensions.
Since the dimensions of your product images are not as per the recommended dimensions, they’re not being used as the OG image.
However, if you wish to remove the OG tags of Rank Math for your products, then you may add the below filter to your theme’s functions.php file.
/** * Hook to remove og:tags */ add_action( 'rank_math/head', function() { if (is_product() ){ remove_all_actions( 'rank_math/opengraph/facebook' ); remove_all_actions( 'rank_math/opengraph/twitter' ); } });This would let Facebook pick the first image it finds on the page.
Hope this helps.
Thank you.
It works!!
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.
You must be logged in to reply to this ticket.