• I am working on using the following filter in the math rank plugin to move your schema inside of rank math so that it outputs as one large block, similar to yoast.

    /**
     * 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 [];
    }, 99, 2);

    I believe your meta data hook wprm_recipe_metadata should work here. I am not a skilled programmer so I am having a bit of trouble. Any guidance or sample code would be greatly appreciated.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Brecht

    (@brechtvds)

    I don’t have any example code to achieve this at the moment, I’m afraid.

    If I had coded it, I would add it as part of WPRM itself. Will have another look at this for one of the next updates though!

    You could try using the wprm_recipe_metadata hook to get the metadata we were about to output, set it to false and then use the actual output in the rank_math hook. But that depends on the timing in which they fire.

Viewing 1 replies (of 1 total)
  • The topic ‘Guidance on adding metadata to rank math using your hook’ is closed to new replies.