Support JSON-LD hook for other plugins

#79361
  • This is a feature suggestion. Yoast SEO supports a hook for other plugins to add additional data to the graph.
    The very popular WP Recipe Maker for instance uses this option to merge Recipe data in the graph generated by Yoast SEO.

    This results in having only 1 well structured and complete graph. Currently I have 2 graphs on my recipe posts, the Article and the Recipe.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math today.

    We do have a filter you can use to extend the Rank math JSON-LD, here it is:

    
    /**
     * 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);
    

    You can also find more hooks to modify your rich snippets here:https://rankmath.com/kb/filters-hooks-api-developer/#richsnippets

    To keep rank math from adding the article schema, you can set the schema in Rank math metabox under schema tab to none and only have your recipe schema for the post.

    Hope that helps. If you have any further question(s), please let us know. Thank you.

    Thats awesome… thanks for the quick and useful answer…

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

The ticket ‘Support JSON-LD hook for other plugins’ is closed to new replies.