-
I am a wordpress novice so please excuse me if this is a poorly structured question.
I was supplied the below code to use SKU as the GTIN for rich snippets, which was working great.
add_filter( “rank_math/snippet/rich_snippet_product_entity”, function( $entity ) {
$entity[‘gtin13’] = $entity[‘sku’];
return $entity;
});I now have a new field for GTIN, which is in the wp_postmeta table of WordPress database using product ID as post_id, with these meta_key values “_cr_gtin”
Can you please help me update the above code to use this new “_cr_gtin” field for GTIN in rankmath?
The ticket ‘Using GTIN from another meta key for rich snippet’ is closed to new replies.