-
I read the article Missing field “priceValidUntil” at https://support.rankmath.com/ticket/missing-field-pricevaliduntil/ and did it successfully. Appreciate the help of Team Rankmath
But I have one more problem which is missing SKU and MPN fields.
The idea I came up with is to get the ID of the product and add it to the SKU and MPN fields. (Because there are so many products, I can’t do this manually)
It looks like this (Might be wrong because I’m not good at coding)
add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
$product->get_id();
$entity['offers']['priceValidUntil'] = '2023-06-01';
$entity['sku'] = $product;
$entity['mpn'] = $product;
return $entity;
});I need a piece of code that is correct and error free. Thank you, Rankmath. I would love to use your Plugins.
The ticket ‘Missing field “SKU and MPN”’ is closed to new replies.