Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
To change this you need to edit the following filter to your specifications: https://rankmath.com/kb/filters-hooks-api-developer/#change-opengraph-image
Here’s an example of adding the image from a custom field called twitter-image
:
add_filter( "rank_math/opengraph/twitter/image", function( $attachment_url ) {
$twitter_image = get_post_meta(get_queried_object_id(), 'twitter-image', true);
if ($twitter_image) {
$twitter_image = $attachment_url;
}
return $attachment_url;
});
Hope this helps solve your issues.
Don’t hesitate to get in touch if you have any other questions.
Hello again.
We will be using feature image instead. Thanks for the help.
IN the mean time we had inserted a default image to social media.
It appears on facebook. But on twitter it does not.
What can it be?
https://pasteboard.co/wFk4nn8fOeOs.png
Thanks
Hello,
I tested the URL on Twitter and the correct image seems to be showing.
Please clear your website and browser’s cache and see if that helps.
Let us know how that goes.
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.