Hello,
Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.
Rank Math plugin doesn’t have any option to change the fields in Post Settings. Although you can use plugin filter to add/change the values on frontend added in ld+json. Below is an example filter code to change the snippet values:
add_filter( "rank_math/json_ld", function( $data, $jsonld ) {
if ( ! is_single() ) {
return $data;
}
$post_type = $jsonld->post->post_type;
$product_id = $jsonld->post_id;
unset( $data['richSnippet'] );
// Use get_post_meta( $product_id, '_meta_key', true ); to get the meta value
$data['richSnippet'] = array(
'@context' => 'https://schema.org',
'@type' => 'Product',
'name' => $jsonld->parts['title'],
'description' => $jsonld->parts['desc'],
'url' => $jsonld->parts['url'],
'sku' => get_post_meta( $product_id, '_meta_key', true ),
'brand' => array(
'@type' => 'Thing',
'name' => get_post_meta( $product_id, '_brand_meta_key', true ),
),
'offers' => array(
'@type' => 'Offer',
'priceCurrency' => get_post_meta( $product_id, '_currency_meta_key', true ),
'price' => get_post_meta( $product_id, '_price_meta_key', true ),
)
);
return $data;
}, 20, 2 );
Hope that helps. 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.