-
Hi,
I have seen this code in the knowledge base, but I need some help with how to edit it.
I have created an attribute called MPN and I would like this filter to pick it up and output as json-ld so GSC will recognise it as the MPN field for my products.
/** * Collect data to output in JSON-LD. * * @param array $unsigned An array of data to output in json-ld. * @param JsonLD $unsigned JsonLD instance. */ add_filter( 'rank_math/json_ld', function( $data, $jsonld ) { return []; }, 10, 2);
Could you help me to edit the above code to get the MPN attribute please.
Cheers,
Paul
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
The ticket ‘Collect attribute using JSON-LD’ is closed to new replies.