Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
We have separated your concern into a new ticket so we can assist you accordingly.
You can use and customize this filter to set a default image from a custom field:
add_filter( "rank_math/opengraph/facebook/image", function( $attachment_url ) {
if(get_post_type() == 'places') { //name of the post type
$attachment_url = get_field('field-name', get_queried_object_id()); //name of the custom field
return $attachment_url;
}
return $attachment_url;
});
Also, the filter can be added to your site using the Code Snippets plugin
https://rankmath.com/kb/wordpress-hooks-actions-filters/code-snippets-plugin
Hope that helps.
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.